Skip to content

Commit

Permalink
Merge commit '3464311c48724b7320db09a08685f4f6f97bb8c3' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
marcdegraef committed Dec 14, 2023
2 parents 22240d1 + 3464311 commit 4218dff
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Docker Image CI Ubuntu

on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]

jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
platforms: linux/amd64, linux/arm64
tags: ${{ secrets.DOCKERHUB_USERNAME }}/emsoft:buildx-latest
43 changes: 43 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
FROM marcdegraef/emsoft_sdk:buildx-latest

ARG TARGETARCH
ARG DEBIAN_FRONTEND=noninteractive

# clone EMsoft and set up SDK Debug/Release
RUN cd ~/EMs \
&& git clone https://github.com/EMsoft-org/EMsoftData.git \
&& git clone https://github.com/EMsoft-org/EMsoft.git \
&& mkdir EMsoftBuild

RUN cd ~/EMs/EMsoftBuild/ && mkdir Debug Release && cd Debug \
&& cmake -DCMAKE_BUILD_TYPE=Debug -DEMsoft_SDK=/opt/EMsoft_SDK -DBUILD_SHARED_LIBS=OFF \
../../EMsoft -G Ninja \
&& ninja \
&& cd ../Release \
&& cmake -DCMAKE_BUILD_TYPE=Release -DEMsoft_SDK=/opt/EMsoft_SDK -DBUILD_SHARED_LIBS=OFF \
../../EMsoft -G Ninja \
&& ninja

# add release version to path
ENV PATH ~/EMs/EMsoftBuild/Release/Bin:$PATH
# add backup path of EMsoft
ENV EMSOFTPATHNAME ~/EMs/EMsoft

# install a new user
ARG user=EMuser
ARG uid=501
ARG gid=3000

# Add new user with our credentials
ENV USERNAME ${user}
RUN useradd -m $USERNAME && \
echo "$USERNAME:$USERNAME" | chpasswd && \
usermod --shell /bin/bash $USERNAME && \
usermod --uid ${uid} $USERNAME && \
groupmod --gid ${gid} $USERNAME

USER ${user}

# run terminal for EMuser at /home/${user}
WORKDIR /home/${user}
CMD ["/bin/bash"]

0 comments on commit 4218dff

Please sign in to comment.