From 9dd90344a76cdd5649b398291f82d674fb3b9b05 Mon Sep 17 00:00:00 2001 From: Maksym Sobolyev Date: Wed, 17 Jul 2024 21:08:20 -0700 Subject: [PATCH] + 91af04f8a8 --- .github/workflows/main.yml | 47 ++++++++++++++++++++++++++++++++++++++ docker/Dockerfile | 16 +++++++++++++ docker/install_conda.sh | 14 ++++++++++++ 3 files changed, 77 insertions(+) create mode 100644 docker/Dockerfile create mode 100755 docker/install_conda.sh diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 51c0cfa..31555c2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -74,3 +74,50 @@ jobs: rm -rf ~/.cache mkdir ~/.cache python Infernos.py -f docker/preload_it_de.yaml + + Docker: + name: Build&Push to DockerHub + if: (github.event_name == 'push' || github.event_name == 'pull_request') + runs-on: ubuntu-latest + env: + DOCKER_REPO: sippylabs/infernos + PLATFORMS: linux/amd64 + BASE_IMAGE: ubuntu:24.10 + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: 'recursive' + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Log in to Docker Hub + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v3 + with: + images: ${{ env.DOCKER_REPO }} + tags: | + type=schedule + type=ref,event=branch + type=ref,event=tag + type=ref,event=pr + type=raw,value=latest,enable={{is_default_branch}} + type=sha + + - name: Build Docker image + uses: docker/build-push-action@v4 + with: + context: . + file: ./docker/Dockerfile + build-args: BASE_IMAGE=${{ env.BASE_IMAGE }} + tags: | + ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..29da266 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,16 @@ +ARG BASE_IMAGE +FROM --platform=$TARGETPLATFORM $BASE_IMAGE as build +LABEL maintainer="Maksym Sobolyev " + +USER root + +# Set Environment Variables +ENV DEBIAN_FRONTEND=noninteractive + +WORKDIR /Infernos + +# Build & install everything +RUN apt-get update +RUN apt-get install --no-install-recommends -y git lsb-release ca-certificates +COPY docker /Infernos/ +RUN /Infernos/install_conda.sh diff --git a/docker/install_conda.sh b/docker/install_conda.sh new file mode 100755 index 0000000..3abd3a3 --- /dev/null +++ b/docker/install_conda.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +set -e +set -x + +apt-get install --no-install-recommends -y curl gpg +curl https://repo.anaconda.com/pkgs/misc/gpgkeys/anaconda.asc | gpg --dearmor > /tmp/conda.gpg +install -o root -g root -m 644 /tmp/conda.gpg /usr/share/keyrings/conda-archive-keyring.gpg +rm /tmp/conda.gpg + +echo "deb [arch=amd64 signed-by=/usr/share/keyrings/conda-archive-keyring.gpg] https://repo.anaconda.com/pkgs/misc/debrepo/conda stable main" > /etc/apt/sources.list.d/conda.list + +apt update +apt-get install --no-install-recommends -y conda