docker-library / docker-library/ruby

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.

Dominant language
Shell
Stars
624
Forks
322
Avg merge
22d 3h
Merged PRs (30d)
1

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

Contributor guide

No contributing guide indexed for this repository

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.

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.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.