Skip to content

Commit

Permalink
fix arm docker builds
Browse files Browse the repository at this point in the history
  • Loading branch information
RogerZhongAWS committed Dec 20, 2024
1 parent c9971aa commit e88b0bf
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 81 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FROM amazonlinux:2 as base

ARG TARGETPLATFORM=linux/amd64
ARG OPENSSL_VERSION=3.0.8

###############################################################################
Expand All @@ -24,8 +25,10 @@ RUN yum -y update \
&& rm -rf /var/cache/yum

WORKDIR /tmp
RUN wget https://registrationcenter-download.intel.com/akdlm/IRC_NAS/e7797b12-ce87-4df0-aa09-df4a272fc5d9/intel-vtune-2025.0.0.1130.sh \
&& sh ./intel-vtune-2025.0.0.1130.sh -a --silent --eula accept
RUN if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then \
wget https://registrationcenter-download.intel.com/akdlm/IRC_NAS/e7797b12-ce87-4df0-aa09-df4a272fc5d9/intel-vtune-2025.0.0.1130.sh \
&& sh ./intel-vtune-2025.0.0.1130.sh -a --silent --eula accept \
fi

###############################################################################
# Install OpenSSL 3.0.8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#https://access.redhat.com/RegistryAuthentication
FROM registry.access.redhat.com/ubi8/ubi AS base

ARG TARGETPLATFORM=linux/amd64
ARG OPENSSL_VERSION=3.0.8

###############################################################################
Expand All @@ -28,8 +29,11 @@ RUN yum -y install \
&& rm -rf /var/cache/yum

WORKDIR /tmp
RUN wget https://registrationcenter-download.intel.com/akdlm/IRC_NAS/e7797b12-ce87-4df0-aa09-df4a272fc5d9/intel-vtune-2025.0.0.1130.sh \
&& sh ./intel-vtune-2025.0.0.1130.sh -a --silent --eula accept
RUN if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then \
wget https://registrationcenter-download.intel.com/akdlm/IRC_NAS/e7797b12-ce87-4df0-aa09-df4a272fc5d9/intel-vtune-2025.0.0.1130.sh \
&& sh ./intel-vtune-2025.0.0.1130.sh -a --silent --eula accept \
fi


###############################################################################
# Install pre-built CMake
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
FROM public.ecr.aws/amazonlinux/amazonlinux:2.0.20230307.0

FROM public.ecr.aws/amazonlinux/amazonlinux:2
ARG OPENSSL_VERSION=3.0.8

RUN yum -y update && yum -y install \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:18.04
FROM ubuntu:22.04

ARG OPENSSL_VERSION=3.0.8

Expand All @@ -10,7 +10,8 @@ RUN apt-get update && apt-get install -y \
build-essential \
cmake \
libtool \
zlib1g-dev
zlib1g-dev \
libssl-dev

RUN mkdir /openssl && cd /openssl && wget https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz \
&& tar -zxvf openssl-${OPENSSL_VERSION}.tar.gz \
Expand Down
77 changes: 4 additions & 73 deletions .github/workflows/base-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,43 +93,6 @@ jobs:
tags: |
public.ecr.aws/${{ env.ECR_BASE_REPO }}:aarch64-ubuntu-latest
platforms: linux/arm64
build-base-docker-image-ubuntu-armv7:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.ECR_USER_AWS_KEY_ID }}
aws-secret-access-key: ${{ secrets.ECR_USER_AWS_KEY_SECRET }}
aws-region: us-east-1
- name: Login to ECR
run: aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: public.ecr.aws/${{ env.ECR_REPO }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build ubuntu Base Image
uses: docker/build-push-action@v3
with:
file: .github/docker-images/base-images/device-client/ubuntu/Dockerfile
context: .
target: base
push: true
tags: |
public.ecr.aws/${{ env.ECR_BASE_REPO }}:armv7-ubuntu-latest
platforms: linux/arm/v7
build-integration-test-base-docker-image-ubuntu-x86_64:
runs-on: ubuntu-latest
permissions:
Expand Down Expand Up @@ -202,42 +165,6 @@ jobs:
tags: |
public.ecr.aws/${{ env.ECR_INTEG_BASE_REPO }}:aarch64-ubuntu-latest
platforms: linux/amd64
build-integration-test-base-docker-image-ubuntu-armv7:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.ECR_USER_AWS_KEY_ID }}
aws-secret-access-key: ${{ secrets.ECR_USER_AWS_KEY_SECRET }}
aws-region: us-east-1
- name: Login to ECR
run: aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: public.ecr.aws/${{ env.ECR_INTEG_BASE_REPO }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build Ubuntu Base Image
uses: docker/build-push-action@v3
with:
file: .github/docker-images/base-images/integration-tests/ubuntu/Dockerfile
context: .
push: true
tags: |
public.ecr.aws/${{ env.ECR_INTEG_BASE_REPO }}:armv7-ubuntu-latest
platforms: linux/arm/v7
build-base-docker-image-amazonlinux-x86_64:
runs-on: ubuntu-latest
permissions:
Expand Down Expand Up @@ -307,6 +234,8 @@ jobs:
with:
file: .github/docker-images/base-images/device-client/amazonlinux/Dockerfile
context: .
build-args: |
OS=linux/arm64
target: base
push: true
tags: |
Expand Down Expand Up @@ -453,6 +382,8 @@ jobs:
with:
file: .github/docker-images/base-images/device-client/ubi8/Dockerfile
context: .
build-args: |
OS=linux/arm64
target: base
push: true
tags: |
Expand Down

0 comments on commit e88b0bf

Please sign in to comment.