From fcfae7d8c6a0e20922f564e69ab67f2df2a7f69e Mon Sep 17 00:00:00 2001 From: Christophe Oudar Date: Mon, 16 Dec 2024 01:59:18 +0100 Subject: [PATCH] fix docker image --- .github/workflows/build_base_image.yml | 24 ++++++++++++++++++------ Dockerfile | 3 +-- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build_base_image.yml b/.github/workflows/build_base_image.yml index 1489698..b901696 100644 --- a/.github/workflows/build_base_image.yml +++ b/.github/workflows/build_base_image.yml @@ -1,29 +1,41 @@ name: Build base image for CI on: - workflow_dispatch: pull_request: branches: - main paths: - 'Dockerfile' - 'Makefile' + workflow_dispatch: + +# GitHub secrets +env: + DOCKER_REGISTRY: ${{ secrets.DOCKER_REGISTRY }} + IMAGE_NAME: dbt-bigquery-monitoring-base + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} jobs: build-base-image: name: Build base image runs-on: ubuntu-latest + steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Checkout uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.sha }} # Check out the code of the PR + - name: Log in to Docker Hub + run: | + echo ${{ secrets.DOCKER_REGISTRY_PASSWORD }} | docker login ${{ secrets.DOCKER_REGISTRY }} -u ${{ secrets.DOCKER_REGISTRY_USER }} --password-stdin + - name: Build base image run: | - make build + docker build -t $IMAGE_NAME:$BRANCH_NAME . + + - name: Push base image + run: | + docker tag $IMAGE_NAME:$BRANCH_NAME $DOCKER_REGISTRY/$IMAGE_NAME:$BRANCH_NAME + docker push $DOCKER_REGISTRY/$IMAGE_NAME:$BRANCH_NAME diff --git a/Dockerfile b/Dockerfile index b262793..cb875d1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -39,7 +39,6 @@ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rust.sh \ # Add Cargo to PATH ENV PATH="/root/.cargo/bin:${PATH}" -RUN cargo # Update pip and install Python dependencies RUN python -m pip install --no-cache-dir --upgrade pip setuptools wheel @@ -53,4 +52,4 @@ RUN pip install --no-cache-dir \ && rm -rf /usr/local/share/doc /root/.cache/ WORKDIR /usr/app/ -ENTRYPOINT ["zsh"] +ENTRYPOINT ["bash"]