I am trying to translate the following docker commands in a docker-compose.yaml file as following:
Docker Commands:
docker run -d \
--name x11-bridge \
-e MODE="tcp" \
-e XPRA_HTML="yes" \
-e DISPLAY=:14 \
-p 10000:10000 \
jare/x11-bridge
docker run -d \
--name emacs-1 \
--volumes-from x11-bridge \
-e DISPLAY=:14 \
jare/emacs emacs
docker run -d \
--name emacs-2 \
--volumes-from x11-bridge \
-e DISPLAY=:14 \
jare/emacs emacs
Docker Compose:
version: "3"
services:
# Desktop: http://localhost:10000/index.html?encoding=rgb32
# Options: http://localhost:10000/connect.html
x11-bridge:
image: "jare/x11-bridge"
stdin_open: true
tty: true
environment:
- MODE=tcp
- XPRA_HTML=yes
- DISPLAY=:14
volumes:
- x11-bridge-pub-keys:/etc/pub-keys
- x11-bridge-X11-unix:/tmp/.X11-unix
ports:
- 10000:10000
emacs-1:
image: "jare/emacs"
stdin_open: true
tty: true
environment:
- DISPLAY=:14
volumes:
- x11-bridge-pub-keys:/etc/pub-keys
- x11-bridge-X11-unix:/tmp/.X11-unix
command: ["emacs"]
depends_on:
- x11-bridge
emacs-2:
image: "jare/emacs"
stdin_open: true
tty: true
environment:
- DISPLAY=:14
volumes:
- x11-bridge-pub-keys:/etc/pub-keys
- x11-bridge-X11-unix:/tmp/.X11-unix
command: ["emacs"]
depends_on:
- x11-bridge
volumes:
x11-bridge-pub-keys:
x11-bridge-X11-unix:
I got the folders that you see in the docker compose from the volumes session of a docker inspect in the x11-bridge
service image.
If I go to the url http://localhost:10000/index.html?encoding=rgb32 the system will behave diferently from when I execute the docker commands directly and from when I use docker-compose up
.
I believe the problem I am facing is that once I map the volumes to the x11-bridge
service using docker-compose, the content already available in the x11-bridge
service image is not copied to the volumes.
Please, can you let me know what am I missing here?
Best regards,
Roger