docker
docker copied to clipboard
Alpine misses the tzdata package and does not handle timezone correctly
The fpm-alpine image misses the tzdata package and does not handle the timezone correctly, leading to inconsistent behavior compared to apache and fpm.
docker run --rm -it -e "TZ=Europe/Luxembourg" postfixadmin:fpm date
Fri Mar 27 22:49:49 CET 2020
docker run --rm -it -e "TZ=Europe/Luxembourg" postfixadmin:fpm-alpine date
Fri Mar 27 21:49:56 UTC 2020
Duplicate of https://github.com/docker-library/php/pull/949
Ok, but then this image adds bash and coreutils when everything could be done in sh (timeout exists in alpine, wget in place of curl...). This is a final image, therefore should offer complete functionalities (correct timestamp of logs) out of the box...
Agreed. Do you know a simple replacement for the /dev/tcp bashism used in https://github.com/postfixadmin/docker/blob/4791374e8a396c3dc359fabcef2fe2a40f7e9891/docker-entrypoint.sh#L52?
Well, timeout, until, echo, and sleep come with alpine. And in alpine you have netcat as well.
Then you can use:nc -w 1 127.0.0.1 3306 -e echo "hello"
Honestly, i'd keep the entrypoint script like this, as it is similar to other apps like roundcubemail and phpmyadmin fpm-alpine versions.
But above all, I'd like to avoid to take this image in my own Dockerfile, add the tzdata package, and repeat it every time a new version comes out...
(As a side note, roundcubemail just merged a similar PR https://github.com/roundcube/roundcubemail-docker/pull/83)
Any news on this PR? Similar PR were submitted, accepted and merged to:
- jenkins alpine, https://github.com/jenkinsci/docker/pull/937#event-3262640468
- phpmyadmin/docker https://github.com/phpmyadmin/docker/pull/283#issuecomment-605675150
- roundcube/docker https://github.com/roundcube/roundcubemail-docker/pull/83
On the other hand there are a lot of images without tzdata (Drupal, Joomla, Wordpress etc.). It's quite common to just use UTC in container deployments.
I'd prefer an upstream solution. Just adding tzdata to every image is not an optimal solution and up to now there aren't many requests for it.