Skip to content

Commit

Permalink
Add rootless runner to the Makefile and improve target platform handl…
Browse files Browse the repository at this point in the history
…ing. (actions#2005)

* Add rootless runner to the Makefile and improve target platform handling

* Add rootless image to docker-push-ubuntu target

* Update runner/Makefile

* Update runner/actions-runner-dind-rootless.dockerfile

* Update runner/actions-runner-dind.dockerfile

* Update runner/actions-runner.dockerfile

Co-authored-by: Yusuke Kuoka <ykuoka@gmail.com>
  • Loading branch information
isarkis and mumoshu committed Nov 26, 2022
1 parent 5e8f576 commit 95c324b
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions runner/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,19 @@ else
export PUSH_ARG="--push"
endif

docker-build-ubuntu:
check-target-platform:
# Handle target platform variants.
# arch command on OS X reports "i386" for Intel CPUs regardless of bitness
ifeq ($(TARGETPLATFORM), $(filter $(TARGETPLATFORM), x86_64 x64 amd64 i386 linux/amd64))
TARGETPLATFORM = linux/amd64
else ifeq ($(TARGETPLATFORM), $(filter $(TARGETPLATFORM), arm64 aarch64 linux/arm64))
TARGETPLATFORM = linux/arm64
else
$(warning Unsupported target platform $(TARGETPLATFORM))
$(error Supported target platforms: linux/amd64 and linux/arm64)
endif

docker-build-ubuntu: check-target-platform
${DOCKER} build \
--build-arg TARGETPLATFORM=${TARGETPLATFORM} \
--build-arg RUNNER_VERSION=${RUNNER_VERSION} \
Expand All @@ -44,7 +56,6 @@ docker-build-ubuntu:
${DOCKER} build \
--build-arg TARGETPLATFORM=${TARGETPLATFORM} \
--build-arg RUNNER_VERSION=${RUNNER_VERSION} \
--build-arg RUNNER_CONTAINER_HOOKS_VERSION=${RUNNER_CONTAINER_HOOKS_VERSION} \
--build-arg DOCKER_VERSION=${DOCKER_VERSION} \
-f actions-runner-dind-rootless.dockerfile \
-t ${DIND_ROOTLESS_RUNNER_NAME}:${TAG} .
Expand Down Expand Up @@ -74,3 +85,9 @@ docker-buildx-ubuntu:
-f actions-runner-dind.dockerfile \
-t "${DIND_RUNNER_NAME}:${TAG}" \
. ${PUSH_ARG}
${DOCKER} buildx build --platform ${PLATFORMS} \
--build-arg RUNNER_VERSION=${RUNNER_VERSION} \
--build-arg DOCKER_VERSION=${DOCKER_VERSION} \
-f actions-runner-dind-rootless.dockerfile \
-t "${DIND_ROOTLESS_RUNNER_NAME}:${TAG}" \
. ${PUSH_ARG}

0 comments on commit 95c324b

Please sign in to comment.