3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Dockerコンテナのタイムゾーン変更

Posted at

タイムゾーンを変更する方法

いくつかタイムゾーンを変更する方法はあります。
ubuntuにてタイムゾーンを変更する方法をまずは記載します。

TZ環境変数で変更

docker run -it --rm -e TZ=Asia/Tokyo

docker-composeで指定する方法

service:
    httpd:
        environment:
            TZ= Asia/Tokyo

/etc/localtimeを変更

TimeZone環境変数で変わらないイメージがある
その場合、/etc/localtimeを変更する


docker run --rm -it -v /etc/localtime:/etc/localtime:ro ubuntu:xenial-20190610 bash

3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?