Skip to content

changing docker file command to entrypoint so we can send arguments #160

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

maayanmord
Copy link

When using ENTRYPOINT instead of COMMAND in a Dockerfile, you gain flexibility when running containers with additional parameters:

With COMMAND: You must override the entire command to add flags
With ENTRYPOINT: You can simply append parameters to the base command
This change simplifies how we pass additional flags like --web.listen-address to the sql_exporter.

Before: using COMMAND

docker run \
  -v `pwd`/config.yml:/config/config.yml \
  -e CONFIG=/config/config.yml \
  -d \
  -p 9237:9237 \
  --name sql_exporter \
  ghcr.io/justwatchcom/sql_exporter \
  sql_exporter \
  --web.listen-address :9123

After: using ENTRYPOINT

docker run \
  -v `pwd`/config.yml:/config/config.yml \
  -e CONFIG=/config/config.yml \
  -d \
  -p 9237:9237 \
  --name sql_exporter \
  ghcr.io/justwatchcom/sql_exporter \
  --web.listen-address :9123

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