mhart / alpine-node

Minimal Node.js Docker Images built on Alpine Linux

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to sync server local timezone with this image?

felipekm opened this issue Β· comments

Hi have the following Dockerfile and I'd like to copy my localserver timezone to this image

FROM mhart/alpine-node:8.5

# App directory
WORKDIR /app
VOLUME /usr/www/app

EXPOSE 5000
CMD [ "npm", "start" ]

How can I achieve that?

Not sure but timezone is simply set by the TZ env variable.
You could accept an build arg and set the env variable in the image.

Should looks like (not tested):

FROM mhart/alpine-node:8.5
ARG TZ="Europe/Brussels" # default πŸ‡§πŸ‡ͺ πŸ‘
ENV TZ=$TZ
# ...
docker build -t love_belgium --build-arg TZ=$TZ .

I've tried it before without success.
Thanks @LoicMahieu πŸ‡­πŸ‡·πŸ‘

Sorry @felipekm – this is a question better directed at either a Docker or Alpine forum – it's not specific to this Node.js image, and I'm not sure what the answer is.