Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Dependencies & Go #35

Merged
merged 19 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 3 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,12 @@ jobs:
shell: bash
steps:
- name: Setup Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: 1.20.4
- uses: actions/checkout@v3
go-version: 1.22.x
- uses: actions/checkout@v4
with:
path: 'ipfs-check'
- name: Build and Start
run: |
cd ipfs-check
go build -o ipfs-check
./ipfs-check &
sleep 300
- uses: ipfs/download-ipfs-distribution-action@v1
- name: Configure Kubo Gateway
run: |
ipfs init;
- uses: ipfs/start-ipfs-daemon-action@v1
- name: Tests
working-directory: ipfs-check
run: |
Expand Down
50 changes: 42 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,42 @@
FROM cimg/go:1.19.1
USER circleci
RUN mkdir -p /home/circleci/app
WORKDIR /home/circleci/app
COPY --chown=circleci:circleci *.go go.mod go.sum ./
EXPOSE 3333
RUN go build
CMD [ "./ipfs-check" ]
# Builder
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.21-bookworm AS builder

LABEL org.opencontainers.image.source=https://github.com/ipfs-shipyard/ipfs-check
LABEL org.opencontainers.image.description="Check if you can find your content on IPFS"
LABEL org.opencontainers.image.licenses=MIT+APACHE_2.0

ARG TARGETPLATFORM TARGETOS TARGETARCH

ENV GOPATH /go
ENV SRC_PATH $GOPATH/src/github.com/ipfs-shipyard/ipfs-check
ENV GO111MODULE on
ENV GOPROXY https://proxy.golang.org

COPY go.* $SRC_PATH/
WORKDIR $SRC_PATH
RUN go mod download

COPY . $SRC_PATH
RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o $GOPATH/bin/ipfs-check

# Runner
FROM debian:bookworm-slim

RUN apt-get update && \
apt-get install --no-install-recommends -y tini ca-certificates curl && \
rm -rf /var/lib/apt/lists/*

ENV GOPATH /go
ENV SRC_PATH $GOPATH/src/github.com/ipfs-shipyard/ipfs-check
ENV DATA_PATH /data/ipfs-check

COPY --from=builder $GOPATH/bin/ipfs-check /usr/local/bin/ipfs-check

RUN mkdir -p $DATA_PATH && \
useradd -d $DATA_PATH -u 1000 -G users ipfs && \
chown ipfs:users $DATA_PATH
VOLUME $DATA_PATH
WORKDIR $DATA_PATH

USER ipfs
ENTRYPOINT ["tini", "--", "/usr/local/bin/ipfs-check", "start"]
167 changes: 0 additions & 167 deletions bitswap.go

This file was deleted.

Loading
Loading