ふり返る暇なんて無いね

日々のメモ書きをつらつらと

docker上のUbuntu16.04でPOSIX::strftime::Compilerのテストが失敗した

その通りで、こんなDockerfileでビルドしたら

FROM ubuntu:16.04

WORKDIR /opt/ex
RUN apt-get update
RUN apt-get install curl perl make -y
RUN curl -L https://cpanmin.us | perl - App::cpanminus

RUN cpanm --verbose POSIX::strftime::Compiler

こんな感じで失敗したというお話。

    #   Failed test at t/04_tzset.t line 35.
    #          got: '+0000'
    #     expected: '+0930'

    #   Failed test 'Australia/Darwin / 2013-1-10 => Australia'
    #   at t/04_tzset.t line 37.
    #                   'Australia'
    #     doesn't match '(?^:A?CST)'

    #   Failed test at t/04_tzset.t line 45.
    #          got: '+0000'
    #     expected: '+0930'

    #   Failed test 'Australia/Darwin / 2013-1-10 => GMT'
    #   at t/04_tzset.t line 47.
    #                   'GMT'
    #     doesn't match '(?^:A?CST)'

    #   Failed test at t/04_tzset.t line 35.
    #          got: '+0000'
    #     expected: '+0930'

    #   Failed test 'Australia/Darwin / 2013-5-10 => Australia'
    #   at t/04_tzset.t line 37.
    #                   'Australia'
    #     doesn't match '(?^:A?CST)'

    #   Failed test at t/04_tzset.t line 45.
    #          got: '+0000'
    #     expected: '+0930'

    #   Failed test 'Australia/Darwin / 2013-5-10 => GMT'
    #   at t/04_tzset.t line 47.
    #                   'GMT'
    #     doesn't match '(?^:A?CST)'

    #   Failed test at t/04_tzset.t line 35.
    #          got: '+0000'
    #     expected: '+0930'

    #   Failed test 'Australia/Darwin / 2013-8-15 => Australia'
    #   at t/04_tzset.t line 37.
    #                   'Australia'
    #     doesn't match '(?^:A?CST)'

    #   Failed test at t/04_tzset.t line 45.
    #          got: '+0000'
    #     expected: '+0930'

    #   Failed test 'Australia/Darwin / 2013-8-15 => GMT'
    #   at t/04_tzset.t line 47.
    #                   'GMT'
    #     doesn't match '(?^:A?CST)'

    #   Failed test at t/04_tzset.t line 35.
    #          got: '+0000'
    #     expected: '+0930'

    #   Failed test 'Australia/Darwin / 2013-11-15 => Australia'
    #   at t/04_tzset.t line 37.
    #                   'Australia'
    #     doesn't match '(?^:A?CST)'

    #   Failed test at t/04_tzset.t line 45.
    #          got: '+0000'
    #     expected: '+0930'

    #   Failed test 'Australia/Darwin / 2013-11-15 => GMT'
    #   at t/04_tzset.t line 47.
    #                   'GMT'
    #     doesn't match '(?^:A?CST)'
    # Looks like you failed 16 tests of 16.
# 以下略

最初見たときtimezone設定してるのにGMT????何やっても+0000なの?????? は???って感じだった。

どうやらtzdataが入ってなかったようで、どっかのタイミングでapt-get install tzdataをしてあげれば良さそう。 イメージがコンパクト過ぎると逆に思いもやらないところでやられてしまうという好例でした。

逆に言うと普段の環境が盛々すぎるとも言えるのかな。