3

I have a container image (rancher/rancher:latest) that I need to pass "--acme-domain=" flag. How can this be done in Azure Aci?

JMan
  • 61
  • 4

2 Answers2

1

After a lot of trial and error I was able to do this using the command parameter in the Azure Resource Manager template. The gist of it was that I had to explicitly call the container entry point, e.g. "command":["./scripts/entry","--acme-domain=foo"]. I suppose you could do the same with the --command-line argument in the Azure CLI.

Vidar Kongsli
  • 826
  • 2
  • 9
  • 20
0

You can try to set an environment variable for your tag "--acme-domain=" in Azure ACI.

For more details, see Set environment variables in Azure ACI.

Charles Xu
  • 29,862
  • 2
  • 22
  • 39
  • Thanks for your suggestion! I tried that and I think turns out that Aci does not support environment variables starting with "--". In my case however the binary running in the container (rancher/rancher) needs the flag passed as a command line argument and will not read it from the environment. – JMan Sep 05 '18 at 08:18
  • @JMan If you want to execute a command in the ACI, you can use the CLI command [`az container exec`](https://learn.microsoft.com/en-us/cli/azure/container?view=azure-cli-latest#az-container-exec). – Charles Xu Sep 05 '18 at 09:36
  • What I want to do is the equivalent of "docker run -d -p 80:80 -p 443:443 rancher/rancher:latest --acme-domain rancher.yourdomain.com" – JMan Sep 05 '18 at 13:33
  • Does it a bash command? If it is, you can set it with a parameter `--command-line` for the command [`az container create`](https://learn.microsoft.com/en-us/cli/azure/container?view=azure-cli-latest#az-container-create). – Charles Xu Sep 06 '18 at 01:25
  • This is what the entry point looks like https://github.com/rancher/rancher/blob/master/package/entrypoint.sh – JMan Sep 07 '18 at 19:03
  • 1
    But shouldn't Aci allow me to start the image the same way docker allows me to do it? Seems odd that I would have to dig in the inner workings of an image. – JMan Sep 07 '18 at 19:05
  • Yeah, it should be. But it seems that it does not support all docker parameters on ACI. Maybe it will support in the future. – Charles Xu Sep 10 '18 at 07:58