I want to print the localdatetim in my Docker logs. I tried the code below, but I always get time in UTC. Lets notice that I'm actually in Rome.
Does anyone knows how to do this?
build:
stage: build
script:
- docker info
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
- echo "Project_data = \""$CI_IMAGE_COMMIT_TAG"\"" > version.py
- docker build --pull --tag $CI_IMAGE_COMMIT_TAG .
- export current_date=$(TZ=Europe/Rome date)
- echo $current_date
- docker push $CI_IMAGE_COMMIT_TAG
tags:
- docker-socket
- build