Reputation: 2485
I'm creating a Dockerfile to customize an image named jboss/wildfly. I need to execute the following command:
/opt/jboss/wildfly/bin/jboss-cli.sh --file=/opt/jboss/wildfly/bin/add-datasource.cli
The command works fine on my host machine, when translated into Dockerfile:
CMD ["/opt/jboss/wildfly/bin/jboss-cli.sh", "--file=","/opt/jboss/wildfly/bin/add-datasource.cli"]
The following error is returned:
'add-datasource.cli' is assumed to be a command(s) but the commands to execute have been specified by another argument: [--file]
Any help ?
Upvotes: 1
Views: 1651
Reputation: 28060
The problem is the syntax you're using. You've split the --file=
incorrectly. You need either:
CMD ["/opt/jboss/wildfly/bin/jboss-cli.sh", "--file=/opt/jboss/wildfly/bin/add-datasource.cli"]
or
CMD ["/opt/jboss/wildfly/bin/jboss-cli.sh", "--file", "/opt/jboss/wildfly/bin/add-datasource.cli"]
The command you have specified would parse as --file= /opt/...
which isn't a valid command line.
Upvotes: 1