Merge pull request #131 from yardenshoham/docker

Add Dockerfile
pull/135/head
Adam Tauber 4 years ago committed by GitHub
commit b654366740
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,8 @@
**
!config
!formatter
!*.go
!go.mod
!sample-config.toml
!docker-entrypoint.sh

@ -0,0 +1,25 @@
FROM alpine:3.12 AS permissions-giver
# Make sure docker-entrypoint.sh is executable, regardless of the build host.
WORKDIR /out
COPY docker-entrypoint.sh .
RUN chmod +x docker-entrypoint.sh
FROM golang:1.14-alpine3.12 AS builder
# Build wuzz
WORKDIR /out
COPY . .
RUN go build .
FROM alpine:3.12 AS organizer
# Prepare executables
WORKDIR /out
COPY --from=builder /out/wuzz .
COPY --from=permissions-giver /out/docker-entrypoint.sh .
FROM alpine:3.12 AS runner
WORKDIR /wuzz
COPY --from=organizer /out /usr/local/bin
ENTRYPOINT [ "docker-entrypoint.sh" ]

@ -0,0 +1,9 @@
#!/bin/sh
set -e
if [ "${1#-}" != "${1}" ] || [ -z "$(command -v "${1}")" ]; then
sleep 0.01
set -- wuzz "$@"
fi
exec "$@"
Loading…
Cancel
Save