Skip to content

Commit

Permalink
build alpine base image (fullstorydev#311)
Browse files Browse the repository at this point in the history
  • Loading branch information
bjrb20 authored Jul 20, 2022
1 parent fec466e commit 8093376
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ RUN go build -o /grpcurl \
-ldflags "-w -extldflags \"-static\" -X \"main.version=$(cat VERSION)\"" \
./cmd/grpcurl

FROM alpine:3 as alpine
WORKDIR /
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=builder /etc/passwd /etc/passwd
COPY --from=builder /grpcurl /bin/grpcurl
USER grpcurl

ENTRYPOINT ["/bin/grpcurl"]

# New FROM so we have a nice'n'tiny image
FROM scratch
WORKDIR /
Expand Down
4 changes: 4 additions & 0 deletions releasing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,15 @@ To re-run only the Docker Hub release steps, we need to build an image with the
# from the root of the repo
echo v2.3.4 > VERSION
docker build -t fullstorydev/grpcurl:v2.3.4 .
docker build -t fullstorydev/grpcurl:v2.3.4-alpine --target alpine .
# now that we have it built, push to Docker Hub
docker push fullstorydev/grpcurl:v2.3.4
docker push fullstorydev/grpcurl:v2.3.4-alpine
# push "latest" tag, too
docker tag fullstorydev/grpcurl:v2.3.4 fullstorydev/grpcurl:latest
docker tag fullstorydev/grpcurl:v2.3.4-alpine fullstorydev/grpcurl:latest-alpine
docker push fullstorydev/grpcurl:latest
docker push fullstorydev/grpcurl:latest-alpine
```

If the `docker push ...` steps fail, you may need to run `docker login`, enter your Docker Hub login credentials, and then try to push again.
Expand Down
2 changes: 2 additions & 0 deletions releasing/do-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ $PREFIX docker buildx create --use --name multiarch-builder --node multiarch-bui
# push to docker hub, both the given version as a tag and for "latest" tag
$PREFIX docker buildx build --platform linux/amd64,linux/s390x,linux/arm64,linux/ppc64le --tag fullstorydev/grpcurl:${VERSION} --tag fullstorydev/grpcurl:latest --push --progress plain --no-cache .
rm VERSION
$PREFIX docker buildx build --platform linux/amd64,linux/s390x,linux/arm64 --tag fullstorydev/grpcurl:${VERSION}-alpine --tag fullstorydev/grpcurl:latest-alpine --push --progress plain --no-cache --target alpine .
rm VERSION

# Homebrew release

Expand Down

0 comments on commit 8093376

Please sign in to comment.