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

Update Dockerfile CMD #24

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Update Dockerfile CMD #24

wants to merge 2 commits into from

Conversation

Tristan-WorkGH
Copy link

Modify the default container output with a clear message instead of running an arbitrary script in dry-run mode, and escape a possible bug in said script.

Please specify the script to run in the container CMD.

Modify the default container output with a clear message.
@Tristan-WorkGH Tristan-WorkGH self-assigned this Nov 13, 2024
@Tristan-WorkGH
Copy link
Author

Tristan-WorkGH commented Nov 13, 2024

When analysing the parent image, we can see that we don't have an entrypoint with alpine image:

$ docker pull python:3.8.12-alpine
3.8.12-alpine: Pulling from library/python
59bf1c3509f3: Pull complete 
07a400e93df3: Pull complete 
2bbaed1c11d1: Pull complete 
9cbeadc4f598: Pull complete 
449a9c3cb364: Pull complete 
Digest: sha256:7c5cf4ffe8a16be5166a197eac378e802e5fbccfe958bd397cb90960916e8985
Status: Downloaded newer image for python:3.8.12-alpine
docker.io/library/python:3.8.12-alpine

$ docker inspect -f '{{json .Config}}' python:3.8.12-alpine | jq
{
  "Hostname": "",
  "Domainname": "",
  "User": "",
  "AttachStdin": false,
  "AttachStdout": false,
  "AttachStderr": false,
  "Tty": false,
  "OpenStdin": false,
  "StdinOnce": false,
  "Env": [
    "PATH=/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
    "LANG=C.UTF-8",
    "GPG_KEY=E3FF2839C048B25C084DEBE9B26995E310250568",
    "PYTHON_VERSION=3.8.12",
    "PYTHON_PIP_VERSION=21.2.4",
    "PYTHON_SETUPTOOLS_VERSION=57.5.0",
    "PYTHON_GET_PIP_URL=https://github.com/pypa/get-pip/raw/38e54e5de07c66e875c11a1ebbdb938854625dd8/public/get-pip.py",
    "PYTHON_GET_PIP_SHA256=e235c437e5c7d7524fbce3880ca39b917a73dc565e0c813465b7a7a329bb279a"
  ],
  "Cmd": [
    "python3"
  ],
  "Image": "sha256:dcb47108d0c702d489dd9c99d54fa2c16c74cb948ee0eecd941d28b92de6d0a5",
  "Volumes": null,
  "WorkingDir": "",
  "Entrypoint": null,
  "OnBuild": null,
  "Labels": null
}

so we can even simplify the CMD for only specifying python args.

It mean that we don't need to specify "python" in the CMD, for CLI and docker-compose.

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

Successfully merging this pull request may close these issues.

1 participant