1

I've been struggling far longer than I should have on this and I'm sure I must be doing something the hard way.

Basically all I want to do is run a docker image in azure (the eos-dev blockchain image). I've gone through and created the container registry, enabled admin control and created the container using:

az container create --resource-group docker --name eosnode --image xxx.azurecr.io/eos-dev --cpu 1 --memory 14 --ip-address public --ports 80 7777 5555 --registry-password "zzz"

Now if this was a local docker instance id simply be able to run:

docker network create testnetwork

And I would get this back:

77af2f92d66895bbf71490b33d775a116d6d8d7be0cbd0a2b3d18ce7336cf611

Now, I'm attempting to do it on the remote azure container like this:

az container exec -g docker --name eosnode --container-name eosnode --exec-command "docker network create testnetwork"

But it returns nothing and I have no idea if it even did anything. What am I missing here?

2
  • Are you able to run the command docker network create testnetwork inside the local docker instance? Commented Oct 3, 2018 at 7:38
  • 1
    I have no idea how to get to the local docker instance. That could be the first step to recovery! I can't find the answer, or maybe the problem is I'm not sure what to search for exactly... Commented Oct 3, 2018 at 7:44

2 Answers 2

2

As you say, you just want to run a docker image in Azure. And I see you create the container instance with the command:

az container create --resource-group docker --name eosnode --image xxx.azurecr.io/eos-dev --cpu 1 --memory 14 --ip-address public --ports 80 7777 5555 --registry-password "zzz"

For this step, the container instance is created in Azure. And you can get the instance information through the command az container show or get logs of the instance with the command az container log.

Also, you can execute the command inside the container instance using the command like this:

az container exec -g resrouceGroup -n instanceName "bash command"

But if you want to run the command docker network create testnetwork inside the container instance, you should install the docker inside the image which you create the container instance from.

Sign up to request clarification or add additional context in comments.

Comments

2
docker network create

creates a docker network on the machine/host, the hash code returned is the id of the network. All 'docker' commands suppose to run on the host instead of in container. Docker network is not necessary to run container in Azure Container instance.

If a container image requires a command to start, usually the command can be found in its document/example with:

docker run <image> <command>

The equivalent way to run the container in azure container instance is:

az container create -g <resourceGroup> -n <name> --image <image> --command-line <command> --restart-policy <Always|OnFailure|Never>
  • --command-line: specify the command to run in the container

  • --restart-policy: Define the behavior when the command exit.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.