Alpine ruby image fails Ruby TZ tests due to lack of tzdata

Open
#502 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
docker, ruby, shell

Research direction

Start by reproducing the contrasting ruby:slim and ruby:alpine commands with TZ=America/Los_Angeles and compare their output. The reported Ruby TZ tests should pass for the Alpine image, or the image should clearly document that tzdata is absent; the linked discussions provide context for that decision.

Written by the indexing model from the issue text.

Description

sudo docker run --env TZ=America/Los_Angeles -it ruby:slim /usr/local/bin/ruby -e 'puts Time.utc(2007, 11, 4, 9, 0, 0).localtime'

2007-11-04 01:00:00 -0800

sudo docker run --env TZ=America/Los_Angeles -it ruby:alpine /usr/local/bin/ruby -e 'puts Time.utc(2007, 11, 4, 9, 0, 0).localtime'

2007-11-04 09:00:00 +0000

Some searching led to this:
https://github.com/docker-library/ruby/issues/218

Pointing to this:
https://serverfault.com/questions/683605/docker-container-time-timezone-will-not-reflect-changes/683651#683651

Pointing to this:
https://github.com/gliderlabs/docker-alpine/issues/136

Which looks a LOT like this is a known issue/WONTFIX, but I must protest. This fails the ruby TZ tests.

I understand that as a minimalist distribution, Alpine, tzdata is not required, but it is required for properly-functioning ruby. If the maintainers believe that it is correct to leave tzdata out of the ruby:alpine image, then surely it is friendly to document the absence of the package, probably via a comment next to one of the apk add statements. (I would prefer it in the build set, as it is needed for the tests to pass.)

Dominant language
Shell
Stars
627
Forks
322
Avg merge
23h 39m
Merged PRs (30d)
2

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from docker-library/ruby

All issues in docker-library/ruby

Similar issues

More Shell/Bash issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.