Skip to content

Commit 8093376

Browse files
authored
build alpine base image (#311)
1 parent fec466e commit 8093376

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

Dockerfile

+9
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@ RUN go build -o /grpcurl \
1616
-ldflags "-w -extldflags \"-static\" -X \"main.version=$(cat VERSION)\"" \
1717
./cmd/grpcurl
1818

19+
FROM alpine:3 as alpine
20+
WORKDIR /
21+
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
22+
COPY --from=builder /etc/passwd /etc/passwd
23+
COPY --from=builder /grpcurl /bin/grpcurl
24+
USER grpcurl
25+
26+
ENTRYPOINT ["/bin/grpcurl"]
27+
1928
# New FROM so we have a nice'n'tiny image
2029
FROM scratch
2130
WORKDIR /

releasing/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,15 @@ To re-run only the Docker Hub release steps, we need to build an image with the
5959
# from the root of the repo
6060
echo v2.3.4 > VERSION
6161
docker build -t fullstorydev/grpcurl:v2.3.4 .
62+
docker build -t fullstorydev/grpcurl:v2.3.4-alpine --target alpine .
6263
# now that we have it built, push to Docker Hub
6364
docker push fullstorydev/grpcurl:v2.3.4
65+
docker push fullstorydev/grpcurl:v2.3.4-alpine
6466
# push "latest" tag, too
6567
docker tag fullstorydev/grpcurl:v2.3.4 fullstorydev/grpcurl:latest
68+
docker tag fullstorydev/grpcurl:v2.3.4-alpine fullstorydev/grpcurl:latest-alpine
6669
docker push fullstorydev/grpcurl:latest
70+
docker push fullstorydev/grpcurl:latest-alpine
6771
```
6872

6973
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.

releasing/do-release.sh

+2
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ $PREFIX docker buildx create --use --name multiarch-builder --node multiarch-bui
5151
# push to docker hub, both the given version as a tag and for "latest" tag
5252
$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 .
5353
rm VERSION
54+
$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 .
55+
rm VERSION
5456

5557
# Homebrew release
5658

0 commit comments

Comments
 (0)