summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathaniel Kierpiec <nkierpiec@chef.io>2021-07-29 15:21:19 -0400
committerNathaniel Kierpiec <nkierpiec@chef.io>2021-07-29 15:21:19 -0400
commit1e43611779dbfa0b3d5666d34eafb3bd42a54307 (patch)
treeabc10cebf025f7f974d64733d1bb78e7b60e8882
parentbdc427e43dc837de75b25eda62a4ed7fa5a7517a (diff)
downloadchef-1e43611779dbfa0b3d5666d34eafb3bd42a54307.tar.gz
update dockerfile to use correct package for os/arch
Signed-off-by: Nathaniel Kierpiec <nkierpiec@chef.io>
-rwxr-xr-x.expeditor/build-docker-images.sh11
-rw-r--r--Dockerfile4
2 files changed, 14 insertions, 1 deletions
diff --git a/.expeditor/build-docker-images.sh b/.expeditor/build-docker-images.sh
index 72f3d4fc5b..2580284997 100755
--- a/.expeditor/build-docker-images.sh
+++ b/.expeditor/build-docker-images.sh
@@ -2,6 +2,15 @@
set -eu -o pipefail
arch=$1
+
+if [[ $arch == "arm64" ]]; then
+ dockerfile_pkg_version="7"
+ dockerfile_arch="aarch64"
+else
+ dockerfile_pkg_version="6"
+ dockerfile_arch="x86_64"
+fi
+
channel="${EXPEDITOR_CHANNEL:-unstable}"
version="${EXPEDITOR_VERSION:?You must manually set the EXPEDITOR_VERSION environment variable to an existing semantic version.}"
@@ -9,6 +18,8 @@ echo "--- Building chef/chef:${version} docker image for ${arch}"
docker build \
--build-arg "CHANNEL=${channel}" \
--build-arg "VERSION=${version}" \
+ --build-arg "ARCH=${dockerfile_arch}" \
+ --build-arg "PKG_VERSION=${dockerfile_pkg_version}" \
-t "chef/chef:${version}-${arch}" .
echo "--- Pushing chef/chef:${version} docker image for ${arch} to dockerhub"
diff --git a/Dockerfile b/Dockerfile
index 372ecfcd4e..f6b6b28b21 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -19,8 +19,10 @@ LABEL maintainer="Chef Software, Inc. <docker@chef.io>"
ARG CHANNEL=stable
ARG VERSION=17.3.48
+ARG ARCH=x86_64
+ARG PKG_VERSION=6
-RUN wget "http://packages.chef.io/files/${CHANNEL}/chef/${VERSION}/el/6/chef-${VERSION}-1.el6.x86_64.rpm" -O /tmp/chef-client.rpm && \
+RUN wget "http://packages.chef.io/files/${CHANNEL}/chef/${VERSION}/el/${PKG_VERSION}/chef-${VERSION}-1.el${PKG_VERSION}.${ARCH}.rpm" -O /tmp/chef-client.rpm && \
rpm2cpio /tmp/chef-client.rpm | cpio -idmv && \
rm -rf /tmp/chef-client.rpm