How to sync server local timezone with this image?
felipekm opened this issue Β· comments
Felipe Kautzmann commented
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?
LoΓ―c Mahieu commented
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 .
Felipe Kautzmann commented
I've tried it before without success.
Thanks @LoicMahieu ππ·π
Michael Hart commented
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.