mirror of https://github.com/asciimoo/wuzz
Add Dockerfile
parent
373046d2cc
commit
8a6eb6ec80
@ -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…
Reference in New Issue