Skip to content

Error running the bridge as Docker container #452

@ppatierno

Description

@ppatierno

Trying to run the bridge just as Docker container outside of Kubernetes gets the following error:

docker run -it strimzi/kafka-bridge:0.17.0
[2020-07-10 08:23:37,145] INFO  <Application :64> [main        ] Strimzi Kafka Bridge 0.17.0 is starting
[2020-07-10 08:23:37,271] ERROR <Application :152> [main        ] Error starting the bridge
org.apache.commons.cli.MissingOptionException: Missing required option: config-file
	at org.apache.commons.cli.DefaultParser.checkRequiredOptions(DefaultParser.java:199) ~[commons-cli-1.4.jar:1.4]
	at org.apache.commons.cli.DefaultParser.parse(DefaultParser.java:130) ~[commons-cli-1.4.jar:1.4]
	at org.apache.commons.cli.DefaultParser.parse(DefaultParser.java:76) ~[commons-cli-1.4.jar:1.4]
	at org.apache.commons.cli.DefaultParser.parse(DefaultParser.java:60) ~[commons-cli-1.4.jar:1.4]
	at io.strimzi.kafka.bridge.Application.main(Application.java:80) [kafka-bridge-0.17.0.jar:0.17.0]

Of course, that's because it needs the --config-file parameter with the configuration properties file.
Anyway even providing it, gets the following error:

docker run -it strimzi/kafka-bridge:0.17.0 --config-file=config/application.properties
docker: Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"--config-file=config/application.properties\": stat --config-file=config/application.properties: no such file or directory": unknown.
ERRO[0000] error waiting for container: context canceled

Even in this case the problem seems to be clear. We are using CMD in the Docker file, instead of ENTRYPOINT so the argument passed on the docker run is got as the command to run and not as a parameter for the entrypoint.
I already built a custom image using ENTRYPOINT instead of CMD and the above command works fine allowing the bridge to start as a Docker container.

This change should not have any impact on how the Strimzi operator deploys the bridge because it's going anyway to override the Kubernetes command with the corresponding Docker script (Kubernetes command is the counterpart of Docker ENTRYPOINT while Kubernetes args should be counterpart of Docker CMD).

I am ready to open a PR for this change, any more thoughts or considerations? @strimzi/maintainers

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions