Skip to content

Commit

Permalink
feat(dump): fix integration tests for multiarch
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtemTrofimushkin committed Nov 23, 2021
1 parent 0618e49 commit 08f874a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Setup Golang
uses: actions/setup-go@v2
with:
Expand Down
5 changes: 2 additions & 3 deletions dumper/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
ARG ARCH=
ARG RUNTIME_VERSION=3.1.20

FROM mcr.microsoft.com/dotnet/core/sdk:3.1-bionic${ARCH} as tools-install
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-bionic as tools-install

RUN dotnet tool install -g dotnet-gcdump && \
dotnet tool install -g dotnet-trace && \
dotnet tool install -g dotnet-dump

FROM mcr.microsoft.com/dotnet/core/runtime:${RUNTIME_VERSION}-bionic${ARCH}
FROM mcr.microsoft.com/dotnet/core/runtime:${RUNTIME_VERSION}-bionic

ARG RUNTIME_VERSION=3.1.20
ARG DOTNET_TOOLS_PATH="/root/.dotnet/tools"
Expand Down
10 changes: 3 additions & 7 deletions hacks/run-integration-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@ if [ "${current_context}" != "${kind_context}" ]; then
fi

arch=${1:-amd64}
if [ "$arch" == "amd64" ]; then
docker_build_args=""
elif [ "$arch" == "arm64" ]; then
docker_build_args="--build-arg ARCH=-arm64v8"
else
if [ "$arch" != "amd64" ] && [ "$arch" != "arm64" ]; then
echo "Unsupported arch, choose from: amd64 or arm64"
exit 1
fi
Expand All @@ -32,10 +28,10 @@ image_tag="latest"
image_repository="kubectl-shovel/dumper-integration-tests"

echo "Building dumper's image..."
docker build \
docker buildx build \
--platform "linux/$arch" \
-t ${image_repository}:${image_tag} \
-f "${project_dir}/dumper/Dockerfile" \
$docker_build_args \
"${project_dir}/dumper"
rm "${project_dir}/dumper/bin/dumper"

Expand Down

0 comments on commit 08f874a

Please sign in to comment.