Application has different appearance when running through docker - user-interface

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?

Related

Docker in Win (Linux containers): docker-compose command fails somehow outside of Visual Studio

I am testing Docker containers, and I managed to create an image, using Visual Studio and Docker Compose, that seems to be OK:
Images:
The image is a .NET Core Console application, very small and simple. It does connect to a Redis server and starts producing some stuff, and logs this to console. This is how it looks if I start the project directly from Visual Studio (no Docker involved):
Now, if I run it via Visual Studio, by setting the "docker-compose" project to Startup, and then pressing the play button on top, that says "Docker Compose", I can see that this command is executed:
docker-compose -f "C:\Git\alfa\AlfaModulesPoc\docker-compose.yml" -f
"C:\Git\alfa\AlfaModulesPoc\docker-compose.override.yml" -f
"C:\Git\alfa\AlfaModulesPoc\obj\Docker\docker-compose.vs.debug.g.yml"
-p dockercompose5247976386926556655 --no-ansi up -d
I now see the Output in VS display the console correctly:
also Docker Desktop shows it:
But, if I run the same command from the command line:
I can see that Docker thinks it is running:
and I then take a look at Docker Desktop, there are no logs being captured any more:
And, the logs are not shown, because it seems that there is no activity at all from the container. I would see data being created in the Redis database, but when started manually from the command prompt, then no data is touched on Redis.
Why isn't the container running properly?
Can I see any errors, exceptions or something to determine what is going on?

Windows GUI application in Docker containers

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?

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?

Build a full Ubuntu desktop docker image

I want to build a full version of Ubuntu 14 desktop as the base image for gui applications, I know how to build on the Ubuntu desktop version by the debootstrap, as described in https://docs.docker.com/articles/baseimages/, but that is a minimal Linux version and some GUI application cannot run perfectly, because there are some basic components missing, such as a font family, so I want the full control of a basic image, thanks!
fcwu/docker-ubuntu-vnc-desktop
https://github.com/fcwu/docker-ubuntu-vnc-desktop provides a convenient setup:
docker run --name ubvnc -p 6080:80 -p 5900:5900 dorowu/ubuntu-desktop-lxde-vnc:bionic
Then either:
visit: http://127.0.0.1:6080/#/ which runs a noVNC more limited JavaScript VNC client
run:
sudo apt-get install tigervnc-viewer
xtigervncviewer :5900
Then inside vinagre, you might want to go into full screen mode to be able to see the full desktop
I also tried vinagre, but it was much laggier when scrolling Firefox on YouTube.
To quit just kill docker on the terminal. And to restart the machine
docker start ubvnc
and then reconnect with VNC. Then to quit the machine:
docker stop ubvnc
You have to wait a few seconds for the VNC server on the guest to start before you can connect.
Chromium won't start from the menu. If you try to launch it from the command line it explains why:
Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
Firefox does not care however.
TODO: no audio. --device /dev/snd did not help:
How to play sound in a docker container
https://forums.docker.com/t/how-to-get-sound/36527
https://github.com/fcwu/docker-ubuntu-vnc-desktop/issues/49
See also:
Can you run GUI applications in a Docker container?
How to open Ubuntu GUI inside a Docker image
Tested on Ubuntu 19.04 host, fcwu/docker-ubuntu-vnc-desktop, dorowu/ubuntu-desktop-lxde-vnc image id: 70516b87e92d.
I don't see the benefits of it, but impossible n'est pas français (impossible isn't French).
Docker Desktop is a way that will give you an X11 server to connect on using SSH.
This Dockerfile creates a docker image and once it's executed it creates a container that runs X11 and SSH services. The ssh is used to forward X11 and provide you encrypted data communication between the docker container and your local machine.

Resources