Skip to content

Commit

Permalink
Merge pull request #6100 from ipfs/gomod/dockerfile
Browse files Browse the repository at this point in the history
gomod: Update Dockerfile, remove Dockerfile.fast
  • Loading branch information
Stebalien authored Mar 19, 2019
2 parents 27ae4fd + 60a43f8 commit e11bbd7
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 88 deletions.
17 changes: 7 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
FROM golang:1.11-stretch
FROM golang:1.12-stretch
MAINTAINER Lars Gierth <lgierth@ipfs.io>

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

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

COPY . $SRC_DIR

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

# Get su-exec, a very minimal tool for dropping privileges,
Expand All @@ -41,7 +38,7 @@ FROM busybox:1-glibc
MAINTAINER Lars Gierth <lgierth@ipfs.io>

# Get the ipfs binary, entrypoint script, and TLS CAs from the build container.
ENV SRC_DIR /go/src/github.com/ipfs/go-ipfs
ENV SRC_DIR /go-ipfs
COPY --from=0 $SRC_DIR/cmd/ipfs/ipfs /usr/local/bin/ipfs
COPY --from=0 $SRC_DIR/bin/container_daemon /usr/local/bin/start_ipfs
COPY --from=0 /tmp/su-exec/su-exec /sbin/su-exec
Expand Down
75 changes: 0 additions & 75 deletions Dockerfile.fast

This file was deleted.

2 changes: 1 addition & 1 deletion test/3nodetest/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ data/filerand: ../bin/random
# just build it every time... this part isn't
# even the lengthy part, and it decreases pain.
docker_ipfs_image:
docker build -t $(IMAGE_NAME) -f Dockerfile.fast .
docker build -t $(IMAGE_NAME) -f Dockerfile .
docker images | grep $(IMAGE_NAME)

clean:
Expand Down
2 changes: 1 addition & 1 deletion test/sharness/t0300-docker-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ TEST_TESTS_DIR=$(dirname "$TEST_SCRIPTS_DIR")
APP_ROOT_DIR=$(dirname "$TEST_TESTS_DIR")

test_expect_success "docker image build succeeds" '
docker_build "$TEST_TESTS_DIR/../Dockerfile.fast" "$APP_ROOT_DIR" >actual ||
docker_build "$TEST_TESTS_DIR/../Dockerfile" "$APP_ROOT_DIR" >actual ||
test_fsh echo "TEST_TESTS_DIR: $TEST_TESTS_DIR" ||
test_fsh echo "APP_ROOT_DIR : $APP_ROOT_DIR" ||
test_fsh cat actual
Expand Down
2 changes: 1 addition & 1 deletion test/sharness/t0301-docker-migrate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ TEST_TESTS_DIR=$(dirname "$TEST_SCRIPTS_DIR")
APP_ROOT_DIR=$(dirname "$TEST_TESTS_DIR")

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

Expand Down

0 comments on commit e11bbd7

Please sign in to comment.