Sign inSign up

theshadowx/qt5.4-nacl

By theshadowx

•Updated almost 11 years ago

Basic image containing Qt compiled with google chrome native client (NaCl)

Image
0

2.0K

theshadowx/qt5.4-nacl repository overview

⁠DockerFile Qt5.4 NaCl

Join the chat at https://gitter.im/theshadowx/DockerFile_Qt5.4_NaCl DockerFile to generate a base image for ubuntu 14.04 with Qt5.4 and NaCl

⁠Building dockerfile

In a termial go to the folder where have put Dockerfile.

Execute this command :

$  sudo docker build -t qtnacl5.4.2 .

It will take a lot of time !!! Then execute this command to run a container :

$  sudo docker run -it qtnacl5.4.2 bash

⁠Using image from Docker Hub

Pull the image

$ docker pull theshadowx/qt5.4-nacl

Run a container

$ sudo docker run -it theshadowx/qt5.4-nacl bash

⁠How to build and deploy your application

So you have made your application and you want to build and deploy it using "QtNaCl", I think the best way is to mount the folder containing the project as a Data Volume⁠ so that you could read/write data directly to the project folder.

N.B. : you have to use the full path to "qmake and nacldeployqt" in order that some QML/Qt files would be generated, otherwise you will have a blank window in the browser when you deploy the application.

⁠Generating Makefile
$ docker run --rm -it -v /path/to/ProjectFolder:/data/example theshadowx/qt5.4-nacl bash -c  "mkdir /data/example/build/ &&  /opt/QtNaCl_5.4/qtbase/bin/qmake /data/example -o /data/example/build/"
⁠Building
$ docker run --rm -it -v /path/to/ProjectFolder:/data/example theshadowx/qt5.4-nacl bash -c "cd /data/example/build && make"
⁠Deploying
$ docker run --rm -it -P -v /path/to/ProjectFolder:/data/example theshadowx/qt5.4-nacl:OoS_Qt5.4.2_NaCl42 bash -c "cd /data/example/build && /opt/QtNaCl_5.4/qtbase/bin/nacldeployqt ProjectName.bc --run"

Now the app is listening to port 8000

Deploying "nacl.bc"
Using SDK "/opt/nacl_sdk/pepper_42"
Qt libs in "/opt/QtNaCl_5.4/qtbase/lib"
Output directory: "/data/example/build"
 
sh: 1: /usr/bin/google-chrome: not found
Serving HTTP on 0.0.0.0 port 8000 ...

⁠Docker Ip
$ ifconfig

As result

docker0   Link encap:Ethernet  HWaddr 02:42:4c:f0:5b:e5  
          inet adr:172.17.42.1  Bcast:0.0.0.0  Masque:255.255.0.0
          adr inet6: fe80::42:4cff:fef0:5be5/64 Scope:Lien
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Packets reçus:1267 erreurs:0 :0 overruns:0 frame:0
          TX packets:796 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 lg file transmission:0 
          Octets reçus:26991144 (26.9 MB) Octets transmis:68019 (68.0 KB)

The IP : 172.17.42.1

⁠Container port

In another terminal :

$ docker ps
CONTAINER IDIMAGECOMMANDCREATEDSTATUSPORTS
834315034c8ctheshadowx/qt5.4-nacl"bash -c 'cd /data/ex"24 seconds agoUp 23 seconds0.0.0.0:32772->8000/tcp

Here the port is 32772

⁠Chrome Browser

Open the chrome browser and put the following address (depending on the IP and the port you got from precedent steps)

http://172.17.42.1:32772

When you launch the app for the first time, you'll have to wait some seconds; But after that, it will be instantaneous.

⁠Location of Qt and NaCl SDK

The NaCl SDK is in

/opt/nacl_sdk/pepper_42

The Qt compiled with NaCl is in

/opt/QtNaCl_5.4

Tag summary

Content type

Image

Digest

sha256:4e139aa1e…

Size

3.6 GB

Last updated

almost 11 years ago

docker pull theshadowx/qt5.4-nacl