diff --git a/.github/workflows/docker-build.yaml b/.github/workflows/docker-build.yaml index a8d91bc..d45d6ac 100644 --- a/.github/workflows/docker-build.yaml +++ b/.github/workflows/docker-build.yaml @@ -17,17 +17,18 @@ jobs: fail-fast: false matrix: base: - - terraform:v2.0.4 + - terraform:v4.0.1 - cli-tools-core:v2.0.2 - cli-tools-ibmcloud:v0.8.3 - cli-tools:v3.0.2 version: - - v1.0 - - v1.1 - - v1.2 + - v1.6 + - v1.7 + - v1.8 + - v1.9 env: - TERRAFORM_LATEST: "v1.2" + TERRAFORM_LATEST: "v1.9" steps: - name: Checkout @@ -90,31 +91,31 @@ jobs: fi echo "Short terraform: ${SHORT_TERRAFORM}" - echo "::set-output name=terraform::$SHORT_TERRAFORM" + echo "terraform=$SHORT_TERRAFORM" >> $GITHUB_OUTPUT echo "Short tag enabled: $SHORT_TAG_ENABLED" - echo "::set-output name=short-enabled::$SHORT_TAG_ENABLED" + echo "short-enabled=$SHORT_TAG_ENABLED" >> $GITHUB_OUTPUT echo "Release tag: ${RELEASE_TAG}" - echo "::set-output name=release-tag::$RELEASE_TAG" + echo "release-tag=$RELEASE_TAG" >> $GITHUB_OUTPUT echo "Release tag enabled: $RELEASE_TAG_ENABLED" - echo "::set-output name=release-tag-enabled::$RELEASE_TAG_ENABLED" + echo "release-tag-enabled=$RELEASE_TAG_ENABLED" >> $GITHUB_OUTPUT echo "Release tag short enabled: $RELEASE_TAG_SHORT_ENABLED" - echo "::set-output name=release-tag-short-enabled::$RELEASE_TAG_SHORT_ENABLED" + echo "release-tag-short-enabled=$RELEASE_TAG_SHORT_ENABLED" >> $GITHUB_OUTPUT echo "Base enabled: $BASE_ENABLED" - echo "::set-output name=base-enabled::$BASE_ENABLED" + echo "base-enabled=$BASE_ENABLED" >> $GITHUB_OUTPUT echo "Latest enabled: $LATEST_ENABLED" - echo "::set-output name=latest-enabled::$LATEST_ENABLED" + echo "latest-enabled=$LATEST_ENABLED" >> $GITHUB_OUTPUT echo "Base: $BASE" - echo "::set-output name=base::$BASE" + echo "base=$BASE" >> $GITHUB_OUTPUT echo "Base version: $BASE_VERSION" - echo "::set-output name=base-version::$BASE_VERSION" + echo "base-version=$BASE_VERSION" >> $GITHUB_OUTPUT - name: Docker CNTK meta ${{ matrix.base }}:${{ matrix.version }} id: cntk-meta diff --git a/Containerfile b/Containerfile index 9a09eab..80dbc29 100644 --- a/Containerfile +++ b/Containerfile @@ -5,8 +5,15 @@ USER root # Adapted from https://github.com/bbrowning/github-runner/blob/master/Dockerfile RUN dnf -y upgrade --security && \ - dnf -y --setopt=skip_missing_names_on_install=False install \ - curl git jq hostname procps findutils which openssl && \ + dnf -y install \ + curl \ + git \ + jq \ + hostname \ + procps \ + findutils \ + which \ + openssl && \ dnf clean all # The UID env var should be used in child Containerfile. @@ -15,10 +22,11 @@ ENV GID=0 ENV USERNAME="runner" # Create our user and their home directory -RUN useradd -m $USERNAME -u $UID -# This is to mimic the OpenShift behaviour of adding the dynamic user to group 0. -RUN usermod -G 0 $USERNAME -ENV HOME /home/${USERNAME} +RUN useradd -m $USERNAME -u $UID && \ + usermod -G 0 $USERNAME + +ENV HOME=/home/${USERNAME} + WORKDIR /home/${USERNAME} # Override these when creating the container. @@ -35,22 +43,19 @@ ENV EPHEMERAL "" # Allow group 0 to modify these /etc/ files since on openshift, the dynamically-assigned user is always part of group 0. # Also see ./uid.sh for the usage of these permissions. -RUN sudo chmod g+w /etc/passwd && \ - sudo touch /etc/sub{g,u}id && \ - sudo chmod -v ug+rw /etc/sub{g,u}id - COPY --chown=${USERNAME}:0 get-runner-release.sh ./ -RUN ./get-runner-release.sh -RUN ./bin/installdependencies.sh -# Set permissions so that we can allow the openshift-generated container user to access home. -# https://docs.openshift.com/container-platform/3.3/creating_images/guidelines.html#openshift-container-platform-specific-guidelines -RUN chown -R ${USERNAME}:0 /home/${USERNAME}/ && \ +RUN chmod g+w /etc/passwd && \ + touch /etc/sub{g,u}id && \ + chmod -v ug+rw /etc/sub{g,u}id && \ + ./get-runner-release.sh && \ + ./bin/installdependencies.sh && \ + chown -R ${USERNAME}:0 /home/${USERNAME}/ && \ chgrp -R 0 /home/${USERNAME}/ && \ chmod -R g=u /home/${USERNAME}/ COPY --chown=${USERNAME}:0 entrypoint.sh uid.sh register.sh get_github_app_token.sh ./ -USER $UID +USER $USERNAME -ENTRYPOINT ./entrypoint.sh +ENTRYPOINT ["./entrypoint.sh"]