Skip to content
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

Added docker build support #722

Open
wants to merge 2 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
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
buildroot/output
buildroot/dl
35 changes: 35 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
FROM stpos-multiboot
#ubuntu:20.04
LABEL authors="Tobias Madlberger"

RUN apt-get update
RUN apt install -y software-properties-common
RUN add-apt-repository -y ppa:rock-core/qt4
RUN apt-get update && apt-get install -y \
build-essential \
rsync \
texinfo \
libncurses-dev \
whois \
unzip \
bc \
gcc=4:9.3.0-1ubuntu2 \
qt4-linguist-tools \
libssl-dev \
git \
wget \
cpio \
python2

RUN if [[ ! -f /usr/bin/python ]] ; then n -s /usr/bin/python2 /usr/bin/python ; else echo Python already linked ; fi

RUN wget https://www.libarchive.org/downloads/libarchive-3.3.1.tar.gz
RUN tar xzf libarchive-3.3.1.tar.gz
WORKDIR libarchive-3.3.1
RUN ./configure
RUN make
RUN make install

WORKDIR /home/dev/StpOs-Multiboot

CMD ["./build.sh"]
14 changes: 14 additions & 0 deletions README_PINN.md
Original file line number Diff line number Diff line change
Expand Up @@ -1233,6 +1233,20 @@ to lower the number to prevent swapping:

If your build machine also has some QT5 components, it is useful to `export QT_SELECT=4` before building to ensure the QT4 component versions are selected.

## Build using docker

When using docker, all required packages will get installed automatically when running, making sure the container is able to build PINN.
When you run the container first time, it'll download all packages and (maybe) ubuntu20.04. Once that's done, it's recommended to create an image from this container,
so you don't have to download it over and over again. Use `docker commit <container-id> pinn-build-image`. Then you have to change all references to ubuntu:20.04
with pinn-build-image in the Dockerfile and docker-compose.yml

Starting the build on linux:
`sudo docker-compose up`

This will execute all the builds and output the binary file into the buildroot/output folder, just like when you execute the BUIDME.sh directly.

The output folder will be created during runtime.

## How to run your Build

In order to set up an SD card with a newly built version of PINN, you will need to:
Expand Down
8 changes: 8 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: "3"

services:
build-stp-os-multiboot:
image: ubuntu:20.04
build: .
volumes:
- path/to/local/pinn/repo:/home/dev/PINN