I want to deploy trufflesuite/ganache-cli
docker image to Azure Container Instances and be able to pass parameters to ganache-cli, like --accounts
or --fork
.
When I try running trufflesuite/ganache-cli:latest
image locally, everything works
PS>
docker context use default
PS>docker run --detach --publish 8545:8545 trufflesuite/ganache-cli:latest --accounts 10
e675e143ddc3ae2e6425700d18725f38360775c38fb0cb41e37a270e4fc5f83a
However, when I switch to Azure context, getting the error below
PS>
docker context use ganacheacicontext
PS>docker run --detach --publish 8545:8545 trufflesuite/ganache-cli:latest --accounts 10
[ ] Running 0/1
Group hopeful-mclean Error
1.3s
containerinstance.ContainerGroupsClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="MoreImageRegistryCredentialsThanContainers" Message="More image registry credentials provided than containers in container group 'hopeful-mclean'."
I do have a resource group, context is correct, as when I try a different image, I am able to deploy it to ACI.
Now, when I use Azure cli I am able to deploy ganache-cli image to Azure Container Instances
az container create --resource-group test-ganache --name ganache --image trufflesuite/ganache-cli:latest --ports 8545 --ip-address Public
However, I can't figure out how to pass parameters to trufflesuite/ganache-cli when using az container create, like accounts, or fork, etc.
It fails with this error if I try to add --accounts 10
to az container create
line above:
unrecognized arguments: --accounts 10
CodePudding user response:
You're passing a ganache-cli parameter as one for the az container create command. Try using the --command-line parameter like this:
--command-line "ganache-cli -a 10"