Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alpine misses the tzdata package and does not handle timezone correctly #24

Open
krufab opened this issue Mar 27, 2020 · 6 comments
Open

Comments

@krufab
Copy link
Contributor

krufab commented Mar 27, 2020

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
krufab pushed a commit to krufab/postfixadmin-docker that referenced this issue Mar 27, 2020
@J0WI
Copy link
Collaborator

J0WI commented Mar 27, 2020

Duplicate of docker-library/php#949

@J0WI J0WI marked this as a duplicate of docker-library/php#949 Mar 27, 2020
@krufab
Copy link
Contributor Author

krufab commented Mar 28, 2020

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...

@J0WI
Copy link
Collaborator

J0WI commented Mar 28, 2020

Agreed. Do you know a simple replacement for the /dev/tcp bashism used in

timeout 15 bash -c "until echo > /dev/tcp/${POSTFIXADMIN_DB_HOST}/${POSTFIXADMIN_DB_PORT}; do sleep 0.5; done"
?

@krufab
Copy link
Contributor Author

krufab commented Mar 28, 2020

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 roundcube/roundcubemail-docker#83)

krufab pushed a commit to krufab/postfixadmin-docker that referenced this issue Mar 29, 2020
@krufab
Copy link
Contributor Author

krufab commented Apr 25, 2020

Any news on this PR?
Similar PR were submitted, accepted and merged to:

@J0WI
Copy link
Collaborator

J0WI commented Apr 25, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants