Skip to content

Commit

Permalink
Support aarch64 in builder images
Browse files Browse the repository at this point in the history
  • Loading branch information
zrhoffman committed Nov 7, 2022
1 parent c586fe9 commit bd164d0
Show file tree
Hide file tree
Showing 8 changed files with 109 additions and 14 deletions.
13 changes: 11 additions & 2 deletions infrastructure/docker/build/Dockerfile-cache-config
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,17 @@ RUN if [[ ${RHEL_VERSION%%.*} -ge 8 ]]; then \
FROM common-dependencies AS cache-config

COPY GO_VERSION /
RUN go_version=$(cat /GO_VERSION) && \
curl -Lo go.tar.gz https://dl.google.com/go/go${go_version}.linux-amd64.tar.gz && \
RUN set -o nounset -o errexit; \
rpm_arch="$(rpm --eval %_arch)" && \
if [[ "$rpm_arch" == x86_64 ]]; then \
arch=amd64; \
elif [[ $rpm_arch == aarch64 ]]; then \
arch=arm64; \
else \
arch="$rpm_arch"; \
fi; \
go_version=$(cat /GO_VERSION) && \
curl -Lo go.tar.gz https://dl.google.com/go/go${go_version}.linux-${arch}.tar.gz && \
tar -C /usr/local -xvzf go.tar.gz && \
ln -s /usr/local/go/bin/go /usr/bin/go && \
rm go.tar.gz
Expand Down
13 changes: 11 additions & 2 deletions infrastructure/docker/build/Dockerfile-grove
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,17 @@ RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-* && \
FROM common-dependencies AS grove

COPY GO_VERSION /
RUN go_version=$(cat /GO_VERSION) && \
curl -Lo go.tar.gz https://dl.google.com/go/go${go_version}.linux-amd64.tar.gz && \
RUN set -o nounset -o errexit; \
rpm_arch="$(rpm --eval %_arch)" && \
if [[ "$rpm_arch" == x86_64 ]]; then \
arch=amd64; \
elif [[ $rpm_arch == aarch64 ]]; then \
arch=arm64; \
else \
arch="$rpm_arch"; \
fi; \
go_version=$(cat /GO_VERSION) && \
curl -Lo go.tar.gz https://dl.google.com/go/go${go_version}.linux-${arch}.tar.gz && \
tar -C /usr/local -xvzf go.tar.gz && \
ln -s /usr/local/go/bin/go /usr/bin/go && \
rm go.tar.gz
Expand Down
13 changes: 11 additions & 2 deletions infrastructure/docker/build/Dockerfile-grovetccfg
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,17 @@ RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-* && \
FROM common-dependencies AS grovetccfg

COPY GO_VERSION /
RUN go_version=$(cat /GO_VERSION) && \
curl -Lo go.tar.gz https://dl.google.com/go/go${go_version}.linux-amd64.tar.gz && \
RUN set -o nounset -o errexit; \
rpm_arch="$(rpm --eval %_arch)" && \
if [[ "$rpm_arch" == x86_64 ]]; then \
arch=amd64; \
elif [[ $rpm_arch == aarch64 ]]; then \
arch=arm64; \
else \
arch="$rpm_arch"; \
fi; \
go_version=$(cat /GO_VERSION) && \
curl -Lo go.tar.gz https://dl.google.com/go/go${go_version}.linux-${arch}.tar.gz && \
tar -C /usr/local -xvzf go.tar.gz && \
ln -s /usr/local/go/bin/go /usr/bin/go && \
rm go.tar.gz
Expand Down
13 changes: 11 additions & 2 deletions infrastructure/docker/build/Dockerfile-tc-health-client
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,17 @@ RUN if [[ ${RHEL_VERSION%%.*} -ge 8 ]]; then \
FROM common-dependencies AS tc-health-client

COPY GO_VERSION /
RUN go_version=$(cat /GO_VERSION) && \
curl -Lo go.tar.gz https://dl.google.com/go/go${go_version}.linux-amd64.tar.gz && \
RUN set -o nounset -o errexit; \
rpm_arch="$(rpm --eval %_arch)" && \
if [[ "$rpm_arch" == x86_64 ]]; then \
arch=amd64; \
elif [[ $rpm_arch == aarch64 ]]; then \
arch=arm64; \
else \
arch="$rpm_arch"; \
fi; \
go_version=$(cat /GO_VERSION) && \
curl -Lo go.tar.gz https://dl.google.com/go/go${go_version}.linux-${arch}.tar.gz && \
tar -C /usr/local -xvzf go.tar.gz && \
ln -s /usr/local/go/bin/go /usr/bin/go && \
rm go.tar.gz
Expand Down
13 changes: 11 additions & 2 deletions infrastructure/docker/build/Dockerfile-traffic_monitor
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,17 @@ RUN yum -y install \
yum -y clean all

COPY GO_VERSION /
RUN go_version=$(cat /GO_VERSION) && \
curl -Lo go.tar.gz https://dl.google.com/go/go${go_version}.linux-amd64.tar.gz && \
RUN set -o nounset -o errexit; \
rpm_arch="$(rpm --eval %_arch)" && \
if [[ "$rpm_arch" == x86_64 ]]; then \
arch=amd64; \
elif [[ $rpm_arch == aarch64 ]]; then \
arch=arm64; \
else \
arch="$rpm_arch"; \
fi; \
go_version=$(cat /GO_VERSION) && \
curl -Lo go.tar.gz https://dl.google.com/go/go${go_version}.linux-${arch}.tar.gz && \
tar -C /usr/local -xvzf go.tar.gz && \
ln -s /usr/local/go/bin/go /usr/bin/go && \
rm go.tar.gz
Expand Down
13 changes: 11 additions & 2 deletions infrastructure/docker/build/Dockerfile-traffic_ops
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,17 @@ RUN yum -y install \
yum -y clean all

COPY GO_VERSION /
RUN go_version=$(cat /GO_VERSION) && \
curl -Lo go.tar.gz https://dl.google.com/go/go${go_version}.linux-amd64.tar.gz && \
RUN set -o nounset -o errexit; \
rpm_arch="$(rpm --eval %_arch)" && \
if [[ "$rpm_arch" == x86_64 ]]; then \
arch=amd64; \
elif [[ $rpm_arch == aarch64 ]]; then \
arch=arm64; \
else \
arch="$rpm_arch"; \
fi; \
go_version=$(cat /GO_VERSION) && \
curl -Lo go.tar.gz https://dl.google.com/go/go${go_version}.linux-${arch}.tar.gz && \
tar -C /usr/local -xvzf go.tar.gz && \
ln -s /usr/local/go/bin/go /usr/bin/go && \
rm go.tar.gz
Expand Down
13 changes: 11 additions & 2 deletions infrastructure/docker/build/Dockerfile-traffic_stats
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,17 @@ RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-* && \
FROM common-dependencies AS traffic-stats

COPY GO_VERSION /
RUN go_version=$(cat /GO_VERSION) && \
curl -Lo go.tar.gz https://dl.google.com/go/go${go_version}.linux-amd64.tar.gz && \
RUN set -o nounset -o errexit; \
rpm_arch="$(rpm --eval %_arch)" && \
if [[ "$rpm_arch" == x86_64 ]]; then \
arch=amd64; \
elif [[ $rpm_arch == aarch64 ]]; then \
arch=arm64; \
else \
arch="$rpm_arch"; \
fi; \
go_version=$(cat /GO_VERSION) && \
curl -Lo go.tar.gz https://dl.google.com/go/go${go_version}.linux-${arch}.tar.gz && \
tar -C /usr/local -xvzf go.tar.gz && \
ln -s /usr/local/go/bin/go /usr/bin/go && \
rm go.tar.gz
Expand Down
32 changes: 32 additions & 0 deletions infrastructure/docker/build/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ services:
# Change BASE_IMAGE to centos when RHEL_VERSION=7
BASE_IMAGE: ${BASE_IMAGE:-rockylinux}
RHEL_VERSION: ${RHEL_VERSION:-8}
x-bake:
platforms:
- linux/amd64
- linux/arm64
volumes:
- ../../..:/trafficcontrol:z

Expand All @@ -45,6 +49,10 @@ services:
# Change BASE_IMAGE to centos when RHEL_VERSION=7
BASE_IMAGE: ${BASE_IMAGE:-rockylinux}
RHEL_VERSION: ${RHEL_VERSION:-8}
x-bake:
platforms:
- linux/amd64
- linux/arm64
volumes:
- ../../..:/trafficcontrol:z

Expand All @@ -57,6 +65,10 @@ services:
# Change BASE_IMAGE to centos when RHEL_VERSION=7
BASE_IMAGE: ${BASE_IMAGE:-rockylinux}
RHEL_VERSION: ${RHEL_VERSION:-8}
x-bake:
platforms:
- linux/amd64
- linux/arm64
volumes:
- ../../..:/trafficcontrol:z

Expand All @@ -69,6 +81,10 @@ services:
# Change BASE_IMAGE to centos when RHEL_VERSION=7
BASE_IMAGE: ${BASE_IMAGE:-rockylinux}
RHEL_VERSION: ${RHEL_VERSION:-8}
x-bake:
platforms:
- linux/amd64
- linux/arm64
volumes:
- ../../..:/trafficcontrol:z

Expand All @@ -93,6 +109,10 @@ services:
# Change BASE_IMAGE to centos when RHEL_VERSION=7
BASE_IMAGE: ${BASE_IMAGE:-rockylinux}
RHEL_VERSION: ${RHEL_VERSION:-8}
x-bake:
platforms:
- linux/amd64
- linux/arm64
volumes:
- ../../..:/trafficcontrol:z
- ../../../.npm:/root/.npm:z
Expand All @@ -119,6 +139,10 @@ services:
# Change BASE_IMAGE to centos when RHEL_VERSION=7
BASE_IMAGE: ${BASE_IMAGE:-rockylinux}
RHEL_VERSION: ${RHEL_VERSION:-8}
x-bake:
platforms:
- linux/amd64
- linux/arm64
volumes:
- ../../..:/trafficcontrol:z

Expand All @@ -143,6 +167,10 @@ services:
# Change BASE_IMAGE to centos when RHEL_VERSION=7
BASE_IMAGE: ${BASE_IMAGE:-rockylinux}
RHEL_VERSION: ${RHEL_VERSION:-8}
x-bake:
platforms:
- linux/amd64
- linux/arm64
volumes:
- ../../..:/trafficcontrol:z

Expand All @@ -155,5 +183,9 @@ services:
# Change BASE_IMAGE to centos when RHEL_VERSION=7
BASE_IMAGE: ${BASE_IMAGE:-rockylinux}
RHEL_VERSION: ${RHEL_VERSION:-8}
x-bake:
platforms:
- linux/amd64
- linux/arm64
volumes:
- ../../..:/trafficcontrol:z

0 comments on commit bd164d0

Please sign in to comment.