Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: auto-generate list of published Docker image references #1516

Open
oberstet opened this issue Jan 29, 2022 · 2 comments
Open

CI: auto-generate list of published Docker image references #1516

oberstet opened this issue Jan 29, 2022 · 2 comments

Comments

@oberstet
Copy link
Contributor

oberstet commented Jan 29, 2022

After building and uploading new Docker images for Autobahn, it would be great to have the new Docker images listed in a way that allows exact reference and direct use in other projects

Docker CLI and docker-compose allows to read env vars from a .env file, that if present, will make env vars already available during "docker-compose" phase (not only inside containers)

# Docker image references for Autobahn v21.1.1 (20220128-dc626948)
# https://hub.docker.com/r/crossbario/autobahn-python/tags?page=1&name=22.1.1

DOCKER_IMAGE_AUTOBAHN_PYTHON=crossbario/autobahn-python@sha256:dfed71b8441e219f2746ff08398d1571e99c666bf85bb4136fe2f9bf1a568650

Above can be computed like this

echo ${AUTOBAHN_VERSION}
echo ${AUTOBAHN_BUILD_ID}

docker inspect --format='{{index .RepoDigests 0}}' \
    crossbario/autobahn-python:cpy-amd64-${AUTOBAHN_VERSION}-${AUTOBAHN_BUILD_ID}
@oberstet
Copy link
Contributor Author

oberstet commented Jan 29, 2022

So say you have 2 env files

  • .env
  • myapp.env

Then you can use a docker-compose.yml like

    myapp:
        container_name: myapp
        image: ${DOCKER_IMAGE_AUTOBAHN_PYTHON}
        env_file:
            - myapp.env
        user: ${UID}:${GID}
        tty: true
        volumes:
            - "/home/ubuntu/myapp/:/app:rw"
        command:
            - python
            - myapp.py

The crucial point is: DOCKER_IMAGE_AUTOBAHN_PYTHON, UID and GID must be defined in .env.

Stuff in myapp.env is only available within myapp.py!

@oberstet
Copy link
Contributor Author

see #1517

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

No branches or pull requests

1 participant