Skip to content
This repository has been archived by the owner on Dec 28, 2024. It is now read-only.

Commit

Permalink
docker: scratch -> distroless
Browse files Browse the repository at this point in the history
  • Loading branch information
palkan committed Nov 1, 2023
1 parent 93aaa24 commit c8b0c4e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
8 changes: 1 addition & 7 deletions .docker/Dockerfile.universal
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
# https://blog.codeship.com/building-minimal-docker-containers-for-go-applications
FROM scratch

ADD .docker/ca-certificates.crt /etc/ssl/certs/
ADD .docker/passwd.nobody /etc/passwd
FROM gcr.io/distroless/static

ARG TARGETPLATFORM
ADD .docker/${TARGETPLATFORM}/anycable-go /usr/local/bin/anycable-go

USER nobody

EXPOSE 8080

ENTRYPOINT ["/usr/local/bin/anycable-go"]
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ build-all: build-clean build-linux
env GOOS=freebsd GOARCH=arm $(GOBUILD) -o "dist/anycable-go-freebsd-arm" cmd/anycable-go/main.go
env GOOS=freebsd GOARCH=amd64 $(GOBUILD) -o "dist/anycable-go-freebsd-amd64" cmd/anycable-go/main.go

build-docker-local:
env GOOS=linux GOARCH=arm64 $(GOBUILD) -o ".docker/linux/arm64/anycable-go" cmd/anycable-go/main.go
docker buildx build --platform linux/arm64 --file .docker/Dockerfile.universal --tag anycable/anycable-go:$(subst v,,$(VERSION))-dev --load .
docker buildx build --platform linux/arm64 --file .docker/Dockerfile.alpine --tag anycable/anycable-go:$(subst v,,$(VERSION))-alpine-dev --load .

# Run server
run:
go run -ldflags $(LD_FLAGS) -tags "mrb gops" ./cmd/anycable-go/main.go
Expand Down

0 comments on commit c8b0c4e

Please sign in to comment.