Windows GUI application in Docker containers - windows

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?

Related

Create Docker Container from Command Fails, but Docker Desktop Succeeds

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.

How to Run ROS 1 / ROS2 in frdmrobotics/playground in Docker on Windows and Connect via VcXsrv

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

docker deamon is not work in windows

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.

How do I run the Hetionet v1.0 docker container?

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?

Application has different appearance when running through docker

I'm successfully running a GUI application through docker, but when doing so, the appearance changes.
Run docker
docker run -i -t --net=host -e DISPLAY -v /tmp/.X11-unix/:/tmp/.X11-unix --env="QT_X11_NO_MITSHM=1" myimage
E.g. when running Firefox, the standard appearance changes to classic (ugly) when running it through docker.
Here are the original and the change appearances:
In my own created app, the formatting also changes because of that.
Any suggestions how to prevent this change when running app through docker?

Resources