Skip to content

Commit

Permalink
DOC: docker image CI
Browse files Browse the repository at this point in the history
  • Loading branch information
adamchengtkc committed Nov 20, 2023
1 parent cd500c0 commit 7c8a6f9
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 21 deletions.
25 changes: 4 additions & 21 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM dolfinx/dolfinx:v0.6.0
# FROM mcr.microsoft.com/devcontainers/base:jammy
ARG DEBIAN_FRONTEND=noninteractive

LABEL org.opencontainers.image.source https://github.com/equinor/warmth
ARG DEBIAN_FRONTEND=noninteractive

RUN DEBIAN_FRONTEND=noninteractive \
&& apt-get update \
Expand All @@ -24,26 +24,9 @@ RUN DEBIAN_FRONTEND=noninteractive \
libffi-dev \
liblzma-dev

# # Python and poetry installation
# # USER $USER
# # ARG HOME="/home/$USER"

# # Don't change. Dolfinx in the base image is only compiled with 3.10
# #ARG PYTHON_VERSION=3.10.6

# # Use poetry pyenv
# #ENV PYENV_ROOT="${HOME}/.pyenv"
# #ENV PATH="${PYENV_ROOT}/shims:${PYENV_ROOT}/bin:${HOME}/.local/bin:/root/.local/bin:$PATH"
RUN useradd -rm -d /home/vscode -s /bin/bash -g root -G sudo -u 1000 vscode -p ""
USER vscode
USER 1000
WORKDIR /home/vscode
ENV HOME=/home/vscode
ENV PATH="/root/.local/bin:$HOME/.local/bin::$PATH"
RUN echo "done 0" \
# # && curl https://pyenv.run | bash \
# # && echo "done 1" \
# # && pyenv install ${PYTHON_VERSION} \
# # && echo "done 2" \
# # && pyenv global ${PYTHON_VERSION} \
# # && echo "done 3" \
&& curl -sSL https://install.python-poetry.org | python3 -
RUN curl -sSL https://install.python-poetry.org | python3 -
42 changes: 42 additions & 0 deletions .github/workflows/build_docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build docker

on:
push:
branches: [ "main" ]
paths:
- '.devcontainer/Dockerfile'
workflow_dispatch:
permissions:
id-token: write
contents: read
packages: write
jobs:
build:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v3
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
with:
driver-opts: |
image=moby/buildkit:v0.11.2
-
name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build
uses: docker/build-push-action@v2
with:
context: .
push: true
platforms: linux/amd64
tags: ghcr.io/equinor/warmth:latest

0 comments on commit 7c8a6f9

Please sign in to comment.