Skip to content

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