Skip to content

Ubuntu Focal build container with HTML5 VNC interface and QtCreator (#343) #344

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Dockerfile
# https://github.com/fcwu/docker-ubuntu-vnc-desktop
FROM dorowu/ubuntu-desktop-lxde-vnc

RUN sudo sed -i 's|http://tw.|http://de.|g' /etc/apt/sources.list && \
sudo apt update && \
sudo apt -y upgrade
RUN sudo apt -y install dirmngr cmake less mc htop git qtcreator qt5-default g++ qttools5-dev \
build-essential qtdeclarative5-dev libqt5svg5-dev qttools5-dev-tools libqt5xmlpatterns5-dev \
libqt5websockets5-dev libqt5x11extras5-dev vim xscreensaver synaptic libglvnd-dev libx11-dev \
libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxcb1-dev

# install smartgit
RUN cd /tmp && wget https://www.syntevo.com/downloads/smartgit/smartgit-20_1_2.deb && sudo dpkg -i smartgit-20_1_2.deb || sudo apt install -fy

# cleanup
RUN sudo apt-get clean && sudo rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

RUN mkdir /code && cd /code && \
git clone git://github.com/ksnip/kColorPicker && \
git clone git://github.com/ksnip/kImageAnnotator && \
git clone git://github.com/KDE/extra-cmake-modules

COPY build-deps.sh /code
RUN /code/build-deps.sh
RUN chown 1000:1000 /code -R
27 changes: 27 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
ksnip Docker container
======================

## Building the container yourself

```bash
# build
docker-compose build ksnip-desktop-build

# run
docker-compose up ksnip-desktop-build
```

## Running the pre-built container

```bash
docker-compose up ksnip-desktop-pre-built
```

## Using the container

- Visit <http://localhost:6080/>
- Run `qtcreator`
- Open project `/code/ksnip/CMakeLists.txt` (*File* menu)
- Press <kbd>Ctrl + B</kbd> to build and run ksnip


28 changes: 28 additions & 0 deletions docker/build-deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash
cd /code || exit 1
export BUILD_TYPE="Release"

echo "--> Install Extra CMake Modules"
cd extra-cmake-modules || exit 1
git pull
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
make && sudo make install
cd ../..

echo "--> Install kColorPicker"
cd kColorPicker || exit 1
git pull
mkdir build && cd build
cmake .. -DBUILD_EXAMPLE=OFF -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
make && sudo make install
cd ../..

echo "--> Install kImageAnnotator"
cd kImageAnnotator || exit 1
git pull
mkdir build && cd build
cmake .. -DBUILD_EXAMPLE=OFF -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
make && sudo make install
cd ../..

34 changes: 34 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#
# Installation:
# docker-compose build
# docker-compose up
#

version: '3'
services:
# https://github.com/fcwu/docker-ubuntu-vnc-desktop
ksnip-desktop-build:
container_name: ksnip-desktop
build: .
volumes:
- /dev/shm:/dev/shm
- ..:/code/ksnip
environment:
- TZ=Europe/Vienna
- USER=ksnip
- PASSWORD=ksnip
ports:
- "6080:80"

ksnip-desktop-pre-built:
image: pbeke/ksnip-desktop
volumes:
- /dev/shm:/dev/shm
- ..:/code/ksnip
environment:
- TZ=Europe/Vienna
- USER=ksnip
- PASSWORD=ksnip
ports:
- "6080:80"