From c5e3a8531722fbfec69ac880c5b8ffff95e43ca5 Mon Sep 17 00:00:00 2001 From: Tommaso Tedeschi Date: Fri, 10 May 2024 15:35:21 +0200 Subject: [PATCH] Add dockerfile and build ci --- .github/workflows/build-images.yaml | 39 +++++++++++++++++++++++++++++ docker/Dockerfile | 12 +++++++++ 2 files changed, 51 insertions(+) create mode 100644 .github/workflows/build-images.yaml create mode 100644 docker/Dockerfile diff --git a/.github/workflows/build-images.yaml b/.github/workflows/build-images.yaml new file mode 100644 index 0000000..f77b717 --- /dev/null +++ b/.github/workflows/build-images.yaml @@ -0,0 +1,39 @@ +name: build-images + +on: + push: + tags: + - "*" +jobs: + arc-sidecar: + runs-on: ubuntu-latest + #env: + # DOCKER_TARGET_PLATFORM: linux/arm64 + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set env + run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Get Repo Owner + id: get_repo_owner + run: echo ::set-output name=repo_owner::$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]') + - name: Build container base image + uses: docker/build-push-action@v5 + with: + context: ./ + outputs: "type=registry,push=true" + tags: | + ghcr.io/${{ steps.get_repo_owner.outputs.repo_owner }}/htcondor-sidecar:${{ env.RELEASE_VERSION }} + ghcr.io/${{ steps.get_repo_owner.outputs.repo_owner }}/htcondor-sidecar:latest + file: ./docker/Dockerfile + platforms: linux/amd64, linux/arm64 \ No newline at end of file diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..427e8b0 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,12 @@ +FROM htcondor/mini:9.0.17-el7 + +RUN pip3 install pyyaml + +COPY handles.py /utils/handles.py +COPY SidecarConfig.yaml /utils/SidecarConfig.yaml +RUN touch /utils/condor_config +RUN mkdir /utils/.knoc + +WORKDIR /utils + +CMD ["/bin/sh", "-c", "/start.sh & python3 handles.py"] \ No newline at end of file