-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
34 lines (25 loc) · 1.08 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
FROM golang:1.19.7-buster as build
ENV GO111MODULE=on
WORKDIR /kubo
COPY build/disable-blockstore-arc-cache.patch /patches/
RUN git clone https://github.com/ipfs/kubo . && \
git checkout v0.19.2 && \
# Apply a patch for disabling the blockstore ARC cache
git apply /patches/disable-blockstore-arc-cache.patch
COPY . /kubo/ipfs-go-ds-storj
# Build the kubo binary with the Storj datastore plugin from the current source code.
RUN go mod edit -replace storj.io/ipfs-go-ds-storj=./ipfs-go-ds-storj && \
echo "\nstorjds storj.io/ipfs-go-ds-storj/plugin 0" >> "plugin/loader/preload_list" && \
go mod tidy && \
# Next line is expected to fail
make build || true && \
go mod tidy && \
make build
# Target image
FROM ipfs/kubo:v0.19.2
# Copy the ipfs from the build container.
ENV SRC_DIR /kubo
COPY --from=build $SRC_DIR/cmd/ipfs/ipfs /usr/local/bin/ipfs
COPY --from=build $SRC_DIR/ipfs-go-ds-storj/docker/container_daemon /usr/local/bin/start_ipfs
# Fix permissions on start_ipfs (ignore the build machine's permissions)
RUN chmod 0755 /usr/local/bin/start_ipfs