From c4c771a30376c30b312becd98dc412b01e6ac1ac Mon Sep 17 00:00:00 2001 From: Jay Chen <1180092+jijiechen@users.noreply.github.com> Date: Tue, 26 Dec 2023 16:53:01 +0800 Subject: [PATCH] Added ability to build over multiple architectures --- Dockerfile | 9 ++++++++- start.sh | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5fae49c..16fb5c8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,7 @@ FROM centos:8 +ARG TARGETARCH + LABEL Maintainer="Robert de Bock " LABEL Description="Base CentOS OpenSSH server image" LABEL CentOS="8" @@ -11,10 +13,15 @@ LABEL build_date="2023-06-13" ENV TINI_VERSION v0.19.0 -ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini +ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-${TARGETARCH} /tini EXPOSE 22 +RUN cd /etc/yum.repos.d/ +RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* +RUN sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* + + # This containers function is specifically to run/test ssh, ignore hints # about having openssh in a Dockerfile. # "WARNING: installing SSH in a container is not recommended. diff --git a/start.sh b/start.sh index 1ca49bc..2df034d 100644 --- a/start.sh +++ b/start.sh @@ -1,4 +1,4 @@ -/bin/bash +#!/bin/bash # Making all required files if they are not existing. (This means # you may add a Docker volume on /etc/ssh or /root to insert your