diff --git a/.github/workflows/build-and-push-images.yml b/.github/workflows/build-and-push-images.yml index 0f4520c..aab22a0 100644 --- a/.github/workflows/build-and-push-images.yml +++ b/.github/workflows/build-and-push-images.yml @@ -26,7 +26,7 @@ jobs: uses: actions/checkout@v3 - name: Log in to the Container registry - uses: docker/login-action@v3 + uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 if: github.event_name != 'pull_request' with: registry: ${{ env.REGISTRY }} @@ -35,7 +35,7 @@ jobs: - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@v5 + uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} flavor: | @@ -45,11 +45,20 @@ jobs: type=ref,event=tag # set latest tag for default branch type=raw,value=latest,enable={{is_default_branch}} - + + - name: Set up QEMU + uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a + with: + platforms: arm64 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd + - name: Build and push Docker image - uses: docker/build-push-action@v4 + uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 with: context: . + platforms: linux/amd64,linux/arm64 push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/Dockerfile b/Dockerfile index 049a600..d32dcec 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:22.04 +FROM ubuntu:24.04 RUN sed -i s/^deb-src.*// /etc/apt/sources.list @@ -48,15 +48,18 @@ ARG RALLY_OPENSTACK_SOURCE=https://github.com/stackhpc/rally-openstack.git ARG RALLY_OPENSTACK_VERSION=master ARG RALLY_OPENSTACK_UPPER_CONSTRAINTS=https://raw.githubusercontent.com/stackhpc/rally-openstack/$RALLY_OPENSTACK_VERSION/upper-constraints.txt -RUN apt-get update && apt-get install --yes sudo python3-dev python3-pip vim git-core crudini jq iputils-ping && \ +RUN apt-get update && apt-get install --yes sudo python3-dev python3-venv vim git-core crudini jq iputils-ping && \ apt clean && \ - pip3 --no-cache-dir install --upgrade pip setuptools && \ useradd -u 65500 -m rally && \ usermod -aG sudo rally && \ echo "rally ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/00-rally-user && \ mkdir /rally && chown -R rally:rally /rally -RUN pip3 install git+$RALLY_OPENSTACK_SOURCE@$RALLY_OPENSTACK_VERSION pymysql psycopg2-binary fixtures --no-cache-dir -c $RALLY_OPENSTACK_UPPER_CONSTRAINTS +ENV VIRTUAL_ENV=/opt/rally-venv +ENV PATH="${VIRTUAL_ENV}/bin:${PATH}" + +RUN python3 -m venv "${VIRTUAL_ENV}" && \ + "${VIRTUAL_ENV}/bin/pip" install git+$RALLY_OPENSTACK_SOURCE@$RALLY_OPENSTACK_VERSION pymysql psycopg2-binary fixtures --no-cache-dir -c $RALLY_OPENSTACK_UPPER_CONSTRAINTS COPY ./etc/motd_for_docker /etc/motd RUN echo '[ ! -z "$TERM" -a -r /etc/motd ] && cat /etc/motd' >> /etc/bash.bashrc