How to use flags in Containers - Azure

Caio Bonani 5 Reputation points
2023-11-16T20:13:21.15+00:00

In my local machine, to run my container in the correct away, I use the following command:

docker run -d \
  --name node1 \
  --network host \
  -v $(pwd)/genesis.json:/opt/besu/genesis.json \
  -v $(pwd)/keys/validator1/key:/opt/besu/key \
  --env-file $(pwd)/common.env \
  --env-file $(pwd)/bootnodes.env \
  node1:latest

How can I specify these flags (--) in my container instance?

NOTE: These flags can't be used in the CMD field in dockerfile, so these commands can't be putted (builded) "inside" the container image, they need to be runned outside.

Azure Container Instances
Azure Container Instances
An Azure service that provides customers with a serverless container experience.
687 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. deherman-MSFT 36,431 Reputation points Microsoft Employee
    2023-11-20T21:48:13.5233333+00:00

    @Caio Bonani
    To use the flags that you mentioned in Azure Container Instances, you can try the following:

    –name: You can specify the name of the container group in the YAML file under the name property. Alternatively, you can use the --name flag in the az container create command in the Azure CLI.

    –network: You can specify the network configuration of the container group in the YAML file under the ipAddress property. You can set the type to either Public or Private, and the ports to the external-facing ports exposed on the container group. Alternatively, you can use the --ip-address and --ports flags in the az container create command in the Azure CLI.

    –env-file: You can specify the environment variables for the container group in the YAML file under the environmentVariables property. You can set the name and value or secureValue for each variable. Alternatively, you can use the --environment-variables and --secure-environment-variables flags in the az container create command in the Azure CLI.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.