Skip to content

Commit

Permalink
Updates alpine based docker image (#515)
Browse files Browse the repository at this point in the history
Removes scratch image to be compatible with the alpine base image and
supports minimal environment to perform runme for shell scripts.

Closes #510
  • Loading branch information
pastuxso authored Feb 26, 2024
1 parent b771cac commit b888ba8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 2 additions & 8 deletions Dockerfile.alpine
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,9 @@ FROM alpine:latest as build
LABEL maintainer="StatefulHQ <mail@stateful.com>"

RUN apk --no-cache add ca-certificates
RUN mkdir /newtmp && chown 1777 /newtmp
RUN mkdir -p /opt/var/runme /opt/bin

FROM scratch
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=build /newtmp /tmp
COPY --from=build /opt /opt

COPY runme /opt/bin/
RUN mkdir -p /opt/var/runme /opt/bin
COPY runme /opt/bin/runme
WORKDIR /opt/var/runme

ENTRYPOINT ["/opt/bin/runme"]
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,9 @@ update-gql-schema:
.PHONY: generate
generate:
go generate ./...

.PHONY: docker
docker:
CGO_ENABLED=0 make build
docker build -f Dockerfile.alpine . -t runme:alpine
docker build -f Dockerfile.ubuntu . -t runme:ubuntu

0 comments on commit b888ba8

Please sign in to comment.