Skip to content

Instantly share code, notes, and snippets.

@J-Rios
Last active April 10, 2023 10:28
Show Gist options
  • Save J-Rios/e4e6575624af2068c8927541213c5cd1 to your computer and use it in GitHub Desktop.
Save J-Rios/e4e6575624af2068c8927541213c5cd1 to your computer and use it in GitHub Desktop.
Setup LinuxDeployQT in a Docker container. Instructions on how to prepare a Docker Container to use linuxdeployqt from an Ubuntu 18.04 host system through a Ubuntu 14.04 Docker container.

Setup LinuxDeployQT in a Docker container

  1. Install Docker:
wget https://raw.githubusercontent.com/J-Rios/BASH-Scripts/master/install/install_docker
sudo chmod +x install_docker
sudo ./install_docker
  1. Get Ubuntu 14.04 Docker base image:
sudo docker pull ubuntu:trusty
  1. Launch a container of the downloaded Ubuntu image:
sudo docker run -d --name dockerdeployqt -it ubuntu:trusty
  1. Enter the Container and get all required elements:
sudo docker exec -it dockerdeployqt bash
cd /root
apt-get update
apt-get -y install wget
apt-get -y install libglib2.0-0
  1. Install QT5:
wget https://raw.githubusercontent.com/J-Rios/BASH-Scripts/master/install/install_qt5
chmod +x install_qt5
./install_qt5
rm -f ./install_qt5
  1. Get and setup linuxdeployqt tool:
wget https://github.com/probonopd/linuxdeployqt/releases/download/6/linuxdeployqt-6-x86_64.AppImage
chmod +x linuxdeployqt-6-x86_64.AppImage
./linuxdeployqt-6-x86_64.AppImage --appimage-extract
mv squashfs-root deployqt
ln -s /root/deployqt/AppRun /usr/local/sbin/linuxdeployqt
rm -f linuxdeployqt-6-x86_64.AppImage
  1. Check that linuxdeployqt is working:
linuxdeployqt
  1. Exit the Container ad stop it (everything is ready to be used):
exit
sudo docker stop dockerdeployqt
@Simran-B
Copy link

In case you want to run an AppImage in a Docker container where FUSE doesn't work unless you run it with --privileged (dangerous),
try the --appimage-extract-and-run option:

linuxdeployqt-continuous-x86_64.AppImage *.desktop -appimage --appimage-extract-and-run

Works on my end and is easier than to manually extract and run the deploy tool.

@GogoLike
Copy link

Create Dockerfile with Ubuntu 18.04

FROM ubuntu:18.04

RUN apt-get update && apt-get install -y
wget
qt5-default
gcc
g++
cmake

RUN wget https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage
&& chmod +x linuxdeployqt-*
&& ./linuxdeployqt-* --appimage-extract
&& mv squashfs-root deployqt
&& ln -s /deployqt/AppRun /usr/local/sbin/linuxdeployqt
&& rm -f linuxdeployqt-*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment