Problem
When I run the following commands the container fails to run
docker container create --name Test1 --env Var1=Val1 --env Var2=Val2 image-name:v1.0
docker start Test1
However, when I create it from Docker Desktop, it works perfectly fine.
I would like to automate some creation of containers, but commands do not appear to behave the same as running from Docker Desktop.
Is Docker Desktop including any additional arguments when creating the container that I would need to include in my command?
Additional Information
I am running a Windows Container on a Windows Computer and running the command in PowerShell.
I have also tried running the command in Command Prompt, but no luck.
Related
I am trying to run the frdmrobotics/playground Docker Image like in this tutorial.
And also Connect the Gui via VcXsrv.
I tried to pull the Image but already only got errors.
Also I have no idea how I should connect VcXsrv from inside the Image
The Problem with Pulling was solved by updating Docker for Windows by starting it and letting it search for an Update.
After a Restart I could Pull the image with docker pull frdmrobotics/playground.
For starting a Container of the Image
docker run -it frdmrobotics/playground
works, but from the Tutorial
cd to the desired development folder e.g.
cd c:/rosProgramming
and then use:
docker run -dt --name robot_env --restart unless-stopped -v %cd%:/root/workspace frdmrobotics/playground
That starts the Container which can then be connected to by using:
docker exec -it robot_env bash
For Connecting VcXsrv I found the Info that I had to set some things in the Image:
export DISPLAY=192.168.105.1:0.0
export LIBGL_ALWAYS_INDIRECT=1
The needed IP Address in that command I got via ipconfig, it is the one which is marked with "(WSL)".
After that when I started a Programm it Opened in my VcXsrv Instance
After that you can use:
cd /root/code/ros1
to navigate to the ros1 environment
I have vm environment which i have created using Microsoft azure cloud. I have installed docker in this vm. I can run docker image without specifying the any terminal like sh or bash and it is working. when i say
docker run -it hello-world --->> it works
docker run -it hello-world sh ---->>> it don't works.
actually i am working on a networking tool kathara where i have to start a virtual lab using many pcs and router and then i have to specify the terminal for them when i want to open any pc or router.
this is the actual error i am getting wheni start conatiner
"critical - 400 client error: bad request ("oci runtime exec failed: exec failed: container_linux.go:349: starting container process caused "exec: \"/bin/bash\": stat /bin/bash: no such file or directory": unknown")"
docker run -it hello-world runs the container's default command: ./hello. That works, because that's what the container is designed to do.
docker run -it hello-world /bin/bash tries to run /bin/bash inside the container. That doesn't work, because that's not what the container is designed to do. That command does not exist within the container.
If you want to run /bin/bash, choose a container that has /bin/bash.
This is even suggested in the output of docker run -it hello-world:
To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash
I have created a simple Hello World GUI application. This is the docker file,
FROM microsoft/windowsservercore:10.0.14393.2007
ADD ./TestDocker/* /
CMD c:\TestDocker.exe
I build it using:
docker build -t test-docker-i .
I run it using:
docker run -it test-docker-i
I see TestDocker.exe in the task manager, but no GUI shown. Can anyone point me if i am doing anything wrong?
I try to run docker in bash ubuntu on windows. But every time I get this message
"Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?". If i run it in powershell - it work. Can somebody help?
Connecting to the docker deamon requires some privilidges that you don't have when starting the bash terminal.
You can however use the docker command terminal which will allow you to interact with the docker deamon.
Found the solution on this post: https://blog.jayway.com/2017/04/19/running-docker-on-bash-on-windows/
Connect Docker on WSL to Docker on Windows
Running docker against an engine on a different machine is actually quite easy, as Docker can expose a TCP endpoint which the CLI can attach to.
This TCP endpoint is turned off by default; to activate it, right-click the Docker icon in your taskbar and choose Settings, and tick the box next to “Expose daemon on tcp://localhost:2375 without TLS”.
With that done, all we need to do is instruct the CLI under Bash to connect to the engine running under Windows instead of to the non-existing engine running under Bash, like this:
$ docker -H tcp://0.0.0.0:2375 images
REPOSITORY TAG IMAGE ID CREATED SIZE
There are two ways to make this permanent – either add an alias for the above command, or better yet, export an environment variable which instructs Docker where to find the host engine:
$ echo "export DOCKER_HOST='tcp://0.0.0.0:2375'" >> ~/.bashrc
$ source ~/.bashrc
Now, running docker commands from Bash works just like they’re supposed to.
$ docker run hello-world
Hello from Docker!This message shows that your installation appears to be working correctly.
I'm trying to run the Hetionet v1.0 docker container mentioned in this SO post.
I've setup a digitalocean droplet with Docker
I ran docker pull dhimmel/hetionet and it worked
Now I run docker run dhimmel/hetionet and the following happens (and never returns to the interactive shell prompt).
If that completed successfully I think the last thing I'm supposed to do is run sh ~/run-docker.sh. Furthermore nothing is live at my droplet's ip_address:7474.
The error in the screenshot above looks a lot like it could be related to some redundant #Path("/") annotation, as described in this SO post's comment, buried in the docker container but I'm not sure.
Is the output from running docker run dhimmel/hetionet supposed to hang my shell? I'm running a 2 GB Memory / 40 GB Disk Droplet on Ubuntu 16.04 with Docker 1.12.5.
Thanks for your interest in the Hetionet Docker.
The output in 3 is expected. It looks like a Docker container successfully launched, downloaded the Hetionet database, and launched the Neo4j server. I'll look into fixing the warnings, but they're not errors, as Neo4j is still launching.
For production, we use a more advanced Docker run command. Depending on your use case, you may want to use the development docker run command:
docker run \
--publish=7474:7474 \
--publish=7687:7687 \
--volume=$HOME/neo4j/hetionet-data:/data \
--volume=$HOME/neo4j/hetionet-logs:/var/lib/neo4j/logs \
dhimmel/hetionet
Both the production and development command map ports. This will make it so the Neo4j server running inside your Docker container is available at http://localhost:7474/. This is most likely what you want. If you're doing this on DigitalOcean, you would replace http://localhost with the IP address of your droplet.
For an interactive shell session in a dhimmel/hetionet container, you can use:
docker run --interactive --tty dhimmel/hetionet bash
However, that command does not launch the Neo4j server -- it just let's you explore the image.
Does this clear things up?