Skip to content

Commit 60a43f8

Browse files
committed
gomod: Update Dockerfile, remove Dockerfile.fast
The main Dockerfile supports dependencies caching now, rendering Dockerfile.fast useless. License: MIT Signed-off-by: Jakub Sztandera <[email protected]>
1 parent 37db5be commit 60a43f8

File tree

5 files changed

+10
-88
lines changed

5 files changed

+10
-88
lines changed

Dockerfile

+7-10
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
1-
FROM golang:1.11-stretch
1+
FROM golang:1.12-stretch
22
MAINTAINER Lars Gierth <[email protected]>
33

4-
# There is a copy of this Dockerfile called Dockerfile.fast,
5-
# which is optimized for build time, instead of image size.
6-
#
7-
# Please keep these two Dockerfiles in sync.
4+
ENV SRC_DIR /go-ipfs
85

9-
ENV GX_IPFS ""
10-
ENV SRC_DIR /go/src/github.com/ipfs/go-ipfs
6+
# Download packages first so they can be cached.
7+
COPY go.mod go.sum $SRC_DIR/
8+
RUN cd $SRC_DIR \
9+
&& go mod download
1110

1211
COPY . $SRC_DIR
1312

1413
# Build the thing.
1514
# Also: fix getting HEAD commit hash via git rev-parse.
16-
# Also: allow using a custom IPFS API endpoint.
1715
RUN cd $SRC_DIR \
1816
&& mkdir .git/objects \
19-
&& ([ -z "$GX_IPFS" ] || echo $GX_IPFS > /root/.ipfs/api) \
2017
&& make build
2118

2219
# Get su-exec, a very minimal tool for dropping privileges,
@@ -41,7 +38,7 @@ FROM busybox:1-glibc
4138
MAINTAINER Lars Gierth <[email protected]>
4239

4340
# Get the ipfs binary, entrypoint script, and TLS CAs from the build container.
44-
ENV SRC_DIR /go/src/github.com/ipfs/go-ipfs
41+
ENV SRC_DIR /go-ipfs
4542
COPY --from=0 $SRC_DIR/cmd/ipfs/ipfs /usr/local/bin/ipfs
4643
COPY --from=0 $SRC_DIR/bin/container_daemon /usr/local/bin/start_ipfs
4744
COPY --from=0 /tmp/su-exec/su-exec /sbin/su-exec

Dockerfile.fast

-75
This file was deleted.

test/3nodetest/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ data/filerand: ../bin/random
2424
# just build it every time... this part isn't
2525
# even the lengthy part, and it decreases pain.
2626
docker_ipfs_image:
27-
docker build -t $(IMAGE_NAME) -f Dockerfile.fast .
27+
docker build -t $(IMAGE_NAME) -f Dockerfile .
2828
docker images | grep $(IMAGE_NAME)
2929

3030
clean:

test/sharness/t0300-docker-image.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ TEST_TESTS_DIR=$(dirname "$TEST_SCRIPTS_DIR")
3333
APP_ROOT_DIR=$(dirname "$TEST_TESTS_DIR")
3434

3535
test_expect_success "docker image build succeeds" '
36-
docker_build "$TEST_TESTS_DIR/../Dockerfile.fast" "$APP_ROOT_DIR" >actual ||
36+
docker_build "$TEST_TESTS_DIR/../Dockerfile" "$APP_ROOT_DIR" >actual ||
3737
test_fsh echo "TEST_TESTS_DIR: $TEST_TESTS_DIR" ||
3838
test_fsh echo "APP_ROOT_DIR : $APP_ROOT_DIR" ||
3939
test_fsh cat actual

test/sharness/t0301-docker-migrate.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ TEST_TESTS_DIR=$(dirname "$TEST_SCRIPTS_DIR")
2121
APP_ROOT_DIR=$(dirname "$TEST_TESTS_DIR")
2222

2323
test_expect_success "docker image build succeeds" '
24-
docker_build "$TEST_TESTS_DIR/../Dockerfile.fast" "$APP_ROOT_DIR" >actual &&
24+
docker_build "$TEST_TESTS_DIR/../Dockerfile" "$APP_ROOT_DIR" >actual &&
2525
IMAGE_ID=$(tail -n1 actual | cut -d " " -f 3)
2626
'
2727

0 commit comments

Comments
 (0)