Skip to content

Instantly share code, notes, and snippets.

@RomainTT
Last active June 21, 2021 09:52
Show Gist options
  • Save RomainTT/c80d2d014a6d0809dcd1e93a24c54faa to your computer and use it in GitHub Desktop.
Save RomainTT/c80d2d014a6d0809dcd1e93a24c54faa to your computer and use it in GitHub Desktop.
Notes Docker

Pour lister les volumes montés par chaque conteneur :

docker ps -a --format '{{ .ID }}' | xargs -I {} docker inspect -f '{{ .Name }}{{ printf "\n" }}{{ range .Mounts }}{{ printf "\n\t" }}{{ .Type }} {{ if eq .Type "bind" }}{{ .Source }}{{ end }}{{ .Name }} => {{ .Destination }}{{ end }}{{ printf "\n" }}' {}

Pour qu’un conteneur ait la même timezone que son hôte :

Au run :

-e TZ=Europe/Amsterdam
# ou bien
-e TZ=`cat /etc/timezone`

Au build :

ENV TZ=Europe/Amsterdam
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

Plus d’infos : https://serverfault.com/questions/683605/docker-container-time-timezone-will-not-reflect-changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment