Fixed support for arm based machines building the Docker container

This commit is contained in:
Michael Weber
2025-08-13 13:42:06 -04:00
parent 1dd0a47cf9
commit 782639293b
+35 -11
View File
@@ -15,14 +15,22 @@ RUN apt-get update && apt-get install -y \
python3-pip \
&& rm -rf /var/lib/apt/lists/*
# Install Node.js and npm
# Install Node.js and npm (works for both architectures)
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
&& apt-get install -y nodejs \
&& npm install -g npm@latest
# Install Go
# Install Go with architecture detection
RUN GO_VERSION=1.21.5 && \
curl -fsSL https://golang.org/dl/go${GO_VERSION}.linux-amd64.tar.gz -o go.tar.gz && \
ARCH=$(dpkg --print-architecture) && \
if [ "$ARCH" = "amd64" ]; then \
GO_ARCH="amd64"; \
elif [ "$ARCH" = "arm64" ]; then \
GO_ARCH="arm64"; \
else \
echo "Unsupported architecture: $ARCH" && exit 1; \
fi && \
curl -fsSL https://golang.org/dl/go${GO_VERSION}.linux-${GO_ARCH}.tar.gz -o go.tar.gz && \
tar -C /usr/local -xzf go.tar.gz && \
rm go.tar.gz
@@ -37,24 +45,40 @@ RUN mkdir -p $GOPATH/src $GOPATH/bin
# Verify Go installation
RUN go version
# Install .NET SDK directly from Microsoft
# Install .NET SDK with architecture detection
RUN mkdir -p /usr/share/dotnet && \
ARCH=$(dpkg --print-architecture) && \
if [ "$ARCH" = "amd64" ]; then \
DOTNET_ARCH="x64"; \
elif [ "$ARCH" = "arm64" ]; then \
DOTNET_ARCH="arm64"; \
else \
echo "Unsupported architecture: $ARCH" && exit 1; \
fi && \
curl -SL https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.sh -o dotnet-install.sh && \
chmod +x dotnet-install.sh && \
./dotnet-install.sh --channel 8.0 --install-dir /usr/share/dotnet && \
./dotnet-install.sh --channel 8.0 --install-dir /usr/share/dotnet --architecture $DOTNET_ARCH && \
ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet && \
rm dotnet-install.sh
# Verify .NET installation
RUN dotnet --info
# Install AWS CLI
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" \
&& unzip awscliv2.zip \
&& ./aws/install \
&& rm -rf aws awscliv2.zip
# Install AWS CLI with architecture detection
RUN ARCH=$(dpkg --print-architecture) && \
if [ "$ARCH" = "amd64" ]; then \
AWS_ARCH="x86_64"; \
elif [ "$ARCH" = "arm64" ]; then \
AWS_ARCH="aarch64"; \
else \
echo "Unsupported architecture: $ARCH" && exit 1; \
fi && \
curl "https://awscli.amazonaws.com/awscli-exe-linux-${AWS_ARCH}.zip" -o "awscliv2.zip" && \
unzip awscliv2.zip && \
./aws/install && \
rm -rf aws awscliv2.zip
# Install Terraform
# Install Terraform (HashiCorp repo supports both architectures automatically)
RUN wget -O- https://apt.releases.hashicorp.com/gpg | gpg --dearmor | tee /usr/share/keyrings/hashicorp-archive-keyring.gpg \
&& echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/hashicorp.list \
&& apt-get update && apt-get install -y terraform