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

CI: Build and store a Docker image #184

Closed
wants to merge 46 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
9ceddf5
First step to produce a Docker image
MakisH Jun 21, 2021
fbb283d
Update token
MakisH Jun 21, 2021
eaaf764
Fix apt-get
MakisH Jun 21, 2021
3371747
Dockerfile: install OpenFOAM, build the adapter
MakisH Jun 21, 2021
94da999
Remove sudo
MakisH Jun 21, 2021
993b954
Dockerfile: install wget
MakisH Jun 21, 2021
9c41996
Specify timezone
MakisH Jun 21, 2021
b1b6e24
Replace timezone set with temporary noninteractive frontend
MakisH Jun 21, 2021
bdcecd2
Build adapter as simple user
MakisH Jun 21, 2021
d2030c5
Create user precice
MakisH Jun 21, 2021
0496b9d
Set shell to bash
MakisH Jun 21, 2021
ffafcf6
Add git
MakisH Jun 21, 2021
817fd71
Install preCICE
MakisH Jun 21, 2021
20d6f7e
Move preCICE installation step earlier
MakisH Jun 21, 2021
edda127
Replace apt-get with dpkg for precice
MakisH Jun 21, 2021
52a689c
Fix preCICE version
MakisH Jun 21, 2021
88df14b
Replace dpkg with apt
MakisH Jun 21, 2021
3ad0a89
Install pkg-config
MakisH Jun 21, 2021
f58cb11
Add build-essential
MakisH Jun 21, 2021
c5632f9
Fix build-essential
MakisH Jun 21, 2021
70441ac
Update OpenFOAM version to 2106
MakisH Sep 14, 2021
21fcce3
Build adapter as default user
MakisH Aug 12, 2021
095ba26
Update path
MakisH Aug 12, 2021
75b2705
Create user precice + set USER ENV variable
MakisH Aug 13, 2021
9c9bd90
Add precice user to sudoers
MakisH Aug 13, 2021
643b9b6
Setup passwordless sudo
MakisH Aug 13, 2021
36956f0
Replace version-specific OpenFOAM binary with link
MakisH Sep 14, 2021
6ee621b
Install openfoam2106-common
MakisH Sep 14, 2021
9ed4d2f
Install more OpenFOAM packages
MakisH Sep 15, 2021
b96af56
Make OpenFOAM version a variable
MakisH Sep 15, 2021
00de8cc
Remove additional OpenFOAM packages
MakisH Sep 15, 2021
783ac59
Base the Docker image on the preCICE image
MakisH Sep 15, 2021
3bc7811
Run APT as sudo
MakisH Sep 15, 2021
4d50c89
Add sudo to add-debian-repo.sh
MakisH Sep 15, 2021
b5df176
Split add-debian-repo and install steps
MakisH Sep 15, 2021
2b7c34d
Change trigger to workflow_dispatch
MakisH Feb 7, 2022
c957eca
Update OpenFOAM version
MakisH Feb 7, 2022
9af8c49
We also need the push event for now
MakisH Feb 7, 2022
5084e2e
What if we don't assume any special user?
MakisH Feb 7, 2022
6b4e0cb
Just a dummy commit
MakisH Feb 8, 2022
1906335
Adding arguments to the dockerfile, to make it more flexible (#292)
valentin-seitz Jul 20, 2023
36ed029
Adding a precice user to the image and having the user install the ad…
Aug 9, 2023
9a359d9
moved into one layyer
Aug 9, 2023
eb9e321
moved the workdir into ~
Aug 9, 2023
1ad0bb6
Merge branch 'develop' into add-ci-docker
MakisH Aug 10, 2023
e0e68de
Bump OpenFOAM version to v2306
MakisH Aug 10, 2023
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
41 changes: 41 additions & 0 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build and store a Docker image to the GHCR
on:
push:
workflow_dispatch:

jobs:
build-docker:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push image
id: docker_build
uses: docker/build-push-action@v2
with:
context: ./
file: ./.github/workflows/Dockerfile
builder: ${{ steps.buildx.outputs.name }}
push: true
tags: ghcr.io/precice/openfoam-adapter:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
22 changes: 22 additions & 0 deletions tools/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
ARG PRECICE_TAG=latest
ARG from=precice/precice:${PRECICE_TAG}
FROM $from
RUN useradd -ms /bin/bash precice
ENV DEBIAN_FRONTEND=noninteractive

ARG OPENFOAM_EXECUTABLE=openfoam2306
# Install OpenFOAM
# Update the package lists prior to adding the openfoam rep. This is needed because the script installs some packages without updating the package lists.
# So sometimes a mirror moved and we get timeouts.
RUN apt-get update &&\
wget -q -O - https://dl.openfoam.com/add-debian-repo.sh | bash &&\
apt-get -qq install ${OPENFOAM_EXECUTABLE}-dev git &&\
ln -s $(which ${OPENFOAM_EXECUTABLE} ) /usr/bin/openfoam

ARG OPENFOAM_ADAPTER_REF=develop
# Build the OpenFOAM adapter

USER precice
WORKDIR /home/precice
RUN git clone --depth 1 --branch ${OPENFOAM_ADAPTER_REF} https://github.com/precice/openfoam-adapter.git &&\
cd openfoam-adapter && /usr/bin/${OPENFOAM_EXECUTABLE} ./Allwmake
Loading