LoginSignup
0
1

More than 5 years have passed since last update.

docker for macコンテナ内の時刻を日本時間に[Aws\S3\Exception\RequestTimeTooSkewedException]

Last updated at Posted at 2017-03-03

表題の件、

docker-compose.yml
container_name:
  volumes:
    - /etc/localtime:/etc/localtime:ro

としてるのに時刻がUTC。

$ date
Fri Mar  3 10:33:46 UTC 2017

そのおかげでS3のSDKがエラーをはくようになった、困る。

[Aws\S3\Exception\RequestTimeTooSkewedException] The difference between the request time and the current time is too large.

そこでコンテナの時刻を合わせるには
下記のようにしたらできた。

docker-compose.yml
container_name:
  volumes:
    - /etc/localtime:/etc/localtime:ro
  links:
    - mysql-common:mysql
    - apache-api:apache-api-fsefo.local.lcl
  environment:
    VIRTUAL_HOST: tag-manager-fsefo.local.lcl
    TZ: Asia/Tokyo
  entrypoint: /etc/services.sh

以前の環境はwindows x vagrantの上にdockerのっけていたのだが(docker-toolbox, docker-machine使用)
docker for macではそれらとはまた別の仮想環境が使われるため
おかしなことになったのだろう。

いろんなとこ見てもうまくいかなかったので一応残しておこう。。

0
1
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
0
1