-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #264 from vsimakhin/feature/update-docker-image
docker multiarch image
- Loading branch information
Showing
7 changed files
with
105 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,25 @@ | ||
FROM debian:bookworm-slim | ||
FROM alpine | ||
|
||
LABEL org.opencontainers.image.source="https://github.com/vsimakhin/web-logbook" \ | ||
org.opencontainers.image.authors="Vladimir Simakhin" \ | ||
org.opencontainers.image.title="Web Logbook" \ | ||
org.opencontainers.image.description="Container image for Web Logbook https://github.com/vsimakhin/web-logbook" | ||
|
||
WORKDIR /web-logbook | ||
|
||
RUN apt-get update && \ | ||
apt-get install ca-certificates libssl3 openssl && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
RUN apk update --no-cache && \ | ||
apk add ca-certificates libssl3 openssl && \ | ||
adduser -g "WebLogbook" -s /usr/sbin/nologin -D -H weblogbook && \ | ||
chown -R weblogbook /web-logbook | ||
|
||
ARG TARGETARCH | ||
|
||
COPY ./dist/web-logbook-linux-amd64/web-logbook /web-logbook/web-logbook | ||
COPY ./dist/web-logbook-linux-${TARGETARCH}/web-logbook /web-logbook/web-logbook | ||
|
||
VOLUME [ "/data", "/certs" ] | ||
|
||
EXPOSE 4000 | ||
|
||
ENTRYPOINT ["./web-logbook", "-dsn", "/data/web-logbook.sql"] | ||
USER weblogbook | ||
ENTRYPOINT ["./web-logbook" ] | ||
CMD ["-dsn", "/data/web-logbook.sql"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,41 @@ | ||
FROM debian:bookworm-slim | ||
# Builder image | ||
FROM alpine AS weblogbookbuilder | ||
|
||
WORKDIR /web-logbook | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y curl jq && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
RUN apk update --no-cache && \ | ||
apk add ca-certificates libssl3 openssl curl jq | ||
|
||
ARG TARGETARCH | ||
|
||
RUN LATEST_RELEASE=$(curl --silent "https://api.github.com/repos/vsimakhin/web-logbook/releases/latest" | \ | ||
jq -r '.assets[] | select(.name == "web-logbook-linux-amd64.tar.gz") | .browser_download_url') && \ | ||
jq -r ".assets[] | select(.name == \"web-logbook-linux-$TARGETARCH.tar.gz\") | .browser_download_url") && \ | ||
curl -L -o web-logbook.tar.gz $LATEST_RELEASE && \ | ||
tar -xzf web-logbook.tar.gz && \ | ||
cp ./web-logbook-linux-amd64/web-logbook ./ && \ | ||
rm -rf web-logbook.tar.gz web-logbook-linux-amd64 | ||
cp ./web-logbook-linux-${TARGETARCH}/web-logbook ./ && \ | ||
rm -rf web-logbook.tar.gz web-logbook-linux-${TARGETARCH} | ||
|
||
# Final image | ||
FROM alpine | ||
|
||
LABEL org.opencontainers.image.source="https://github.com/vsimakhin/web-logbook" \ | ||
org.opencontainers.image.authors="Vladimir Simakhin" \ | ||
org.opencontainers.image.title="Web Logbook" \ | ||
org.opencontainers.image.description="Container image for Web Logbook https://github.com/vsimakhin/web-logbook" | ||
|
||
WORKDIR /web-logbook | ||
|
||
RUN apk update --no-cache && \ | ||
apk add ca-certificates libssl3 openssl && \ | ||
adduser -g "WebLogbook" -s /usr/sbin/nologin -D -H weblogbook && \ | ||
chown -R weblogbook /web-logbook | ||
|
||
COPY --from=weblogbookbuilder /web-logbook/web-logbook /web-logbook/web-logbook | ||
|
||
VOLUME [ "/data", "/certs" ] | ||
|
||
EXPOSE 4000 | ||
|
||
ENTRYPOINT ["./web-logbook", "-dsn", "/data/web-logbook.sql"] | ||
USER weblogbook | ||
ENTRYPOINT ["./web-logbook" ] | ||
CMD ["-dsn", "/data/web-logbook.sql"] |