Build and push docker image to DockerHub
ADD
.github/workflows/docker-build.yml
+name: Build docker image
+on:
+ push:
+ branches:
+ - master
+ workflow_dispatch:
+
+jobs:
+ docker:
+ runs-on: ubuntu-latest
+ steps:
+ -
+ uses: actions/checkout@v2
+ -
+ name: Set up Docker Buildx
+ uses: docker/setup-buildx-action@v1
+ -
+ name: Login to DockerHub
+ uses: docker/login-action@v1
+ with:
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
+ password: ${{ secrets.DOCKERHUB_TOKEN }}
+ -
+ name: Build and push
+ uses: docker/build-push-action@v2
+ with:
+ file: "./docker/ripes.dockerfile"
+ context: "./docker/"
+ push: true
+ tags: matsievskiysv/ripes:latest

ADD
docker/README.md
+## Build docker image
+
+To build latest version of Ripes from `master` branch issue the command
+
+```bash
+docker build --rm --tag ripes -f ripes.dockerfile .
+```
+
+Or to build from specific branch
+
+```bash
+docker build --rm --build-arg BRANCH=my_branch --tag ripes:latest -f ripes.dockerfile .
+```
+
+## Run docker container
+
+Enable external connection to your X server (run for each session)
+```bash
+xhost local:root
+```
+**Note:** you may add this line to `~/.xsessionrc` file to avoid having to run it for each session
+
+After that, issue the command
+
+```bash
+docker run --rm -it --net=host -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix ripes:latest
+```

ADD
docker/ripes.dockerfile
+FROM debian:bookworm-backports
+
+ARG DEBIAN_FRONTEND=noninteractive
+RUN apt-get update -q \
+ && apt-get install -qy --no-install-recommends \
+ build-essential \
+ cmake \
+ gcc-riscv64-unknown-elf \
+ git \
+ libpthread-stubs0-dev \
+ libqt5charts5-dev \
+ libqt5svg5-dev \
+ python3 \
+ && apt-get autoremove \
+ && apt-get autoclean \
+ && rm -rf /var/lib/apt/lists/*
+
+ARG GIT_SSL_NO_VERIFY=true
+ENV LC_ALL=C.UTF-8 SHELL=/bin/bash
+
+ARG BRANCH=master
+RUN git clone --recursive --branch ${BRANCH} https://github.com/mortbopet/Ripes.git /tmp/ripes \
+ && cmake -S /tmp/ripes/ -B /tmp/ripes/build \
+ -Wno-dev -DRIPES_BUILD_TESTS=ON -DVSRTL_BUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Release \
+ && cmake --build /tmp/ripes/build \
+ && cd /tmp/ripes/build/test \
+ && ./tst_assembler && ./tst_expreval && ./tst_riscv \
+ && cd /tmp/ripes/build \
+ && make install \
+ && cd /tmp \
+ && rm -rf /tmp/ripes
+
+ENTRYPOINT ["Ripes"]

Build and push docker image to DockerHub