inetum-orleans / docker-devbox-ddb

Erase environment differences, make developers happy !
https://inetum-orleans.github.io/docker-devbox-ddb
MIT License
4 stars 1 forks source link

Remove docker-py dependency in favor of docker cli commands #207

Closed Toilal closed 3 years ago

Toilal commented 3 years ago

fixuid feature use docker-py to grab metadata from images (Cmd and Entrypoint), but it causes permission issues when running in bitbucket pipelines.

The way bitbucket brings docker CLI inside bitbucket CI containers is exotic and probably cause docker-py to fail configure itself with valid credentials.

I think it would be better to remove this dependency, and retrieve the same data with docker cli commands.

Image repo digest can be retrieve with the following command

docker pull postgres:14.0
docker inspect --format '{{json .RepoDigests}}' postgres:14.0
# ["postgres@sha256:eb83331cc518946d8ee1b52e6d9e97d0cdef6195b7bf25323004f2968e91a825"]

Cmd and Entrypoint with the following ones

docker inspect --format '{{.Config.Cmd}}' postgres:14.0
# [postgres]
docker inspect --format '{{.Config.Entrypoint}}' postgres:14.0
# ["docker-entrypoint.sh"]