diff --git a/Dockerfile b/Dockerfile index d5fd012..a47ae35 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,9 +13,11 @@ RUN --mount=type=cache,target=/root/.cache/go-build \ FROM alpine AS certs RUN apk add -U \ - ca-certificates + ca-certificates \ + tzdata FROM scratch ENTRYPOINT ["/mc-router"] COPY --from=certs /etc/ssl/certs/ /etc/ssl/certs +COPY --from=certs /usr/share/zoneinfo /usr/share/zoneinfo COPY --from=builder /build/mc-router /mc-router diff --git a/Dockerfile.release b/Dockerfile.release index 7848071..d03b037 100644 --- a/Dockerfile.release +++ b/Dockerfile.release @@ -1,11 +1,13 @@ FROM alpine AS certs RUN apk add -U \ - ca-certificates + ca-certificates \ + tzdata FROM scratch ARG TARGETPLATFORM COPY --from=certs /etc/ssl/certs/ /etc/ssl/certs +COPY --from=certs /usr/share/zoneinfo /usr/share/zoneinfo COPY $TARGETPLATFORM/mc-router / ENTRYPOINT ["/mc-router"] diff --git a/README.md b/README.md index 27c35e4..34bc08c 100644 --- a/README.md +++ b/README.md @@ -121,6 +121,15 @@ Some other features included: The [multi-architecture image published at Docker Hub](https://hub.docker.com/repository/docker/itzg/mc-router) supports amd64, arm64, and arm32v6 (i.e. RaspberryPi). +## Timezone + +The image bundles `tzdata` so log timestamps can match your local timezone. Pick one: + +- Set the `TZ` environment variable, e.g. `TZ=America/New_York` +- Bind mount the host's zone file: `-v /etc/localtime:/etc/localtime:ro` + +If neither is set, timestamps are in UTC. + ## Docker Compose Usage The diagram below shows how this `docker-compose.yml` configures two Minecraft server services named `vanilla` and `forge`, which also become the internal network aliases. _Notice those services don't need their ports exposed since the internal networking allows for the inter-container access._