Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] Build Docker Image on Mac M1 / ARM64 "not supported architecture 'armhf'" #1010

Open
smi-schleupen opened this issue Jun 19, 2024 · 0 comments

Comments

@smi-schleupen
Copy link

smi-schleupen commented Jun 19, 2024

Hello everyone, I would like to create a Docker image and install the AWS CLI tools into it. I build the image as a dev container with vscode. The Docker build basically works. However, I run into the error when installing the AWS CLI:

16.64 (*) Installing AWS CLI...
16.67 AWS CLI does not support machine architecture 'armhf'. Please use an x86-64 or ARM64 machine.
16.67 ERROR: Feature "AWS CLI" (ghcr.io/devcontainers/features/aws-cli) failed to install! Look at the documentation at https://github.com/devcontainers/features/tree/main/src/aws-cli for help troubleshooting this error.

From my point of view, maybe a mapping armhf) architectureStr=aarch64 ;; should probably help here.

I`m using a Macbook Air m1

Here is my Dockerfile:

FROM mcr.microsoft.com/powershell:lts-ubuntu-22.04-arm32
WORKDIR /src

RUN apt update && apt -y upgrade && \
    apt install -y python3-pip &&\
    apt install -y shellcheck

RUN apt install -y python3-virtualenv && \
    apt install -y pre-commit && \
    apt install -y curl && \
    apt install -y unzip && \ 
    apt install -y git && \ 
    apt install -y sudo

ARG USERNAME=vscode
ARG USER_UID=1000
ARG USER_GID=$USER_UID

RUN groupadd --gid $USER_GID $USERNAME \
    && useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
    && apt-get update \
    && apt-get install -y sudo \
    && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
    && chmod 0440 /etc/sudoers.d/$USERNAME
USER $USERNAME

and my .devcontainer

 {
	"name": "Bash (Community)",
	"build": {
		"dockerfile": "Dockerfile"
	},
	"mounts": [
		"source=${localEnv:HOME}/.ssh,target=/home/vscode/.ssh,type=bind,consistency=cached",
		"source=${localEnv:HOME}/.aws,target=/home/vscode/.aws,type=bind,consistency=cached"
	],

	"customizations": {
		"vscode": {
			"settings": {
				"terminal.integrated.defaultProfile.linux": "pwsh"
			},
			"extensions": [
				"mads-hartmann.bash-ide-vscode",
			]
		}
	},

	"forwardPorts": [],

	"remoteEnv": {
		"PATH": "${containerEnv:PATH}:${localWorkspaceFolder}/scripts"
	},

	"remoteUser": "vscode",
	"features": {
		"ghcr.io/devcontainers/features/aws-cli:1": {},
		"ghcr.io/devcontainers/features/terraform:1": {
			"version": "1.4.6",
			"tflint": "0.46.1"
		},
		"ghcr.io/dhoeric/features/terraform-docs:1": {},
		"ghcr.io/dhoeric/features/tfsec:1": {}
	}
}
@smi-schleupen smi-schleupen changed the title Build Docker Image on Mac M1 / ARM64 "not supported architecture 'armhf'" [bug] Build Docker Image on Mac M1 / ARM64 "not supported architecture 'armhf'" Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant