diff options
| author | 2025-09-04 15:25:24 -0300 | |
|---|---|---|
| committer | 2025-09-04 15:25:24 -0300 | |
| commit | 0f1b67611317ab7163a134573b525eb10b415ea8 (patch) | |
| tree | b0c09d2a31302f2c5d71642add1117034badfa15 | |
| parent | Updated RELEASE_NOTES. (diff) | |
| download | penes-snac2-0f1b67611317ab7163a134573b525eb10b415ea8.tar.gz penes-snac2-0f1b67611317ab7163a134573b525eb10b415ea8.tar.xz penes-snac2-0f1b67611317ab7163a134573b525eb10b415ea8.zip | |
Add tzdata to container image
Install Alpine package `tzdata` to the container image.
When running it, set timezone from environment variable TZ if not empty.
| -rw-r--r-- | Dockerfile | 3 | ||||
| -rwxr-xr-x | examples/docker-entrypoint.sh | 8 |
2 files changed, 8 insertions, 3 deletions
| @@ -9,8 +9,9 @@ RUN apk -U --no-progress --no-cache add curl-dev build-base && \ | |||
| 9 | cp examples/docker-entrypoint.sh /build/out/usr/local/bin/entrypoint.sh | 9 | cp examples/docker-entrypoint.sh /build/out/usr/local/bin/entrypoint.sh |
| 10 | 10 | ||
| 11 | FROM alpine:${ALPINE_VERSION} | 11 | FROM alpine:${ALPINE_VERSION} |
| 12 | RUN apk -U --no-progress --no-cache add libcurl | 12 | RUN apk -U --no-progress --no-cache add libcurl tzdata |
| 13 | COPY --from=builder /build/out / | 13 | COPY --from=builder /build/out / |
| 14 | EXPOSE 5050 | 14 | EXPOSE 5050 |
| 15 | VOLUME [ "/data" ] | 15 | VOLUME [ "/data" ] |
| 16 | ENTRYPOINT [ "/usr/local/bin/entrypoint.sh" ] | 16 | ENTRYPOINT [ "/usr/local/bin/entrypoint.sh" ] |
| 17 | |||
diff --git a/examples/docker-entrypoint.sh b/examples/docker-entrypoint.sh index a6216b2..d198bf2 100755 --- a/examples/docker-entrypoint.sh +++ b/examples/docker-entrypoint.sh | |||
| @@ -1,7 +1,11 @@ | |||
| 1 | #! /bin/sh | 1 | #! /bin/sh |
| 2 | if [ ! -e /data/data/server.json ] | 2 | if [ -n "$TZ" ] ; then |
| 3 | then | 3 | ln -snf "/usr/share/zoneinfo/$TZ" /etc/localtime \ |
| 4 | && echo "$TZ" > /etc/timezone | ||
| 5 | fi | ||
| 6 | if [ ! -e /data/data/server.json ] ; then | ||
| 4 | echo -ne "0.0.0.0\r\n8001\r\nlocalhost\r\n\r\n\r\n" | snac init /data/data | 7 | echo -ne "0.0.0.0\r\n8001\r\nlocalhost\r\n\r\n\r\n" | snac init /data/data |
| 5 | snac adduser /data/data testuser | 8 | snac adduser /data/data testuser |
| 6 | fi | 9 | fi |
| 7 | SSLKEYLOGFILE=/data/key snac httpd /data/data | 10 | SSLKEYLOGFILE=/data/key snac httpd /data/data |
| 11 | |||