-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
Signed-off-by: Sumner Evans <[email protected]>
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,21 @@ | ||
FROM docker.io/golang:alpine as builder | ||
FROM golang:1-alpine3.16 AS builder | ||
This comment has been minimized.
Sorry, something went wrong. |
||
|
||
RUN apk add --no-cache olm-dev gcc musl-dev libstdc++-dev | ||
RUN apk add --no-cache git ca-certificates build-base su-exec olm-dev | ||
|
||
COPY . /app | ||
WORKDIR /app | ||
COPY . /build | ||
WORKDIR /build | ||
RUN go build -o /usr/bin/standupbot | ||
|
||
RUN go build | ||
FROM alpine:3.16 | ||
|
||
FROM docker.io/alpine | ||
ENV UID=1337 \ | ||
GID=1337 | ||
This comment has been minimized.
Sorry, something went wrong.
jcgruenhage
Contributor
|
||
|
||
RUN apk add --no-cache olm libstdc++ tzdata | ||
RUN apk add --no-cache su-exec ca-certificates olm bash | ||
This comment has been minimized.
Sorry, something went wrong.
jcgruenhage
Contributor
|
||
|
||
COPY --from=builder /app/standupbot /usr/local/bin/standupbot | ||
COPY --from=builder /usr/bin/standupbot /usr/bin/standupbot | ||
COPY --from=builder /build/config.sample.json /opt/standupbot/config.sample.json | ||
COPY --from=builder /build/docker-run.sh /docker-run.sh | ||
VOLUME /data | ||
|
||
CMD ["/docker-run.sh"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/sh | ||
|
||
if [[ -z "$GID" ]]; then | ||
GID="$UID" | ||
fi | ||
|
||
# Define functions. | ||
function fixperms { | ||
chown -R $UID:$GID /data /opt/standupbot | ||
} | ||
|
||
if [[ ! -f /data/config.json ]]; then | ||
cp /opt/standupbot/config.sample.json /data/config.json | ||
echo "Didn't find a config file." | ||
echo "Copied default config file to /data/config.json" | ||
echo "Modify that config file to your liking." | ||
exit | ||
fi | ||
|
||
cd /data | ||
fixperms | ||
exec su-exec $UID:$GID /usr/bin/standupbot |
Removing the
docker.io/
prefix means this is less portable than before. If you're on podman for example and don't havedocker.io
configured as the default registry, then this doesn't build anymore