-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Erik Stromdahl <[email protected]>
- Loading branch information
Showing
5 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,3 @@ | ||
#! /bin/sh | ||
|
||
docker build -t erstrom/qt . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,32 @@ | ||
#! /bin/sh | ||
# | ||
|
||
# Fix for running GUI programs from within the docker container: | ||
# | ||
# Make xorg disable access control, i.e. let any x client connect to our | ||
# server. | ||
xhost | ||
|
||
# In order to let the container connect to the pulseaudio server over TCP, | ||
# the module-native-protocol-tcp module must be enabled: | ||
# | ||
# load-module module-native-protocol-tcp | ||
|
||
# 172.17.0.1 is the default host ip address of the docker network interface | ||
# (docker0). In case this is changed (e.g. docker container not using NAT | ||
# address) the below env var must of course be updated. | ||
PULSE_SERVER_TCP_ENV="-e PULSE_SERVER=tcp:172.17.0.1:4713" | ||
|
||
# Create the container with all options needed to let a GUI program | ||
# like qtcreator connect to the host xorg server. | ||
# The current user home directory is also mounted directly into the | ||
# container. | ||
docker run -it \ | ||
--privileged \ | ||
-v /tmp/.X11-unix:/tmp/.X11-unix \ | ||
-v /home/`id -nu`:/home/`id -nu` \ | ||
-e DISPLAY=unix$DISPLAY \ | ||
$PULSE_SERVER_TCP_ENV \ | ||
--name qtcreator \ | ||
erstrom/qt \ | ||
qtcreator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,31 @@ | ||
#! /bin/sh | ||
# | ||
|
||
# Fix for running GUI programs from within the docker container: | ||
# | ||
# Make xorg disable access control, i.e. let any x client connect to our | ||
# server. | ||
xhost | ||
|
||
# In order to let the container connect to the pulseaudio server over TCP, | ||
# the module-native-protocol-tcp module must be enabled: | ||
# | ||
# load-module module-native-protocol-tcp | ||
|
||
# 172.17.0.1 is the default host ip address of the docker network interface | ||
# (docker0). In case this is changed (e.g. docker container not using NAT | ||
# address) the below env var must of course be updated. | ||
PULSE_SERVER_TCP_ENV="-e PULSE_SERVER=tcp:172.17.0.1:4713" | ||
|
||
# Create the container with all options needed to let a GUI program | ||
# like qtcreator connect to the host xorg server. | ||
# The current user home directory is also mounted directly into the | ||
# container. | ||
docker run -it \ | ||
--privileged \ | ||
-v /tmp/.X11-unix:/tmp/.X11-unix \ | ||
-v /home/`id -nu`:/home/`id -nu` \ | ||
-e DISPLAY=unix$DISPLAY \ | ||
$PULSE_SERVER_TCP_ENV \ | ||
--name qt-sh \ | ||
erstrom/qt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,9 @@ | ||
#! /bin/sh | ||
|
||
# Fix for running GUI programs from within the docker container: | ||
# | ||
# Make xorg disable access control, i.e. let any x client connect to our | ||
# server. | ||
xhost | ||
|
||
docker start qtcreator --attach --interactive |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,9 @@ | ||
#! /bin/sh | ||
|
||
# Fix for running GUI programs from within the docker container: | ||
# | ||
# Make xorg disable access control, i.e. let any x client connect to our | ||
# server. | ||
xhost | ||
|
||
docker start qt-sh --attach --interactive |