I’m running this Docker file in MAC M1:
Dockerfile
ARG VARIANT=16-bullseye
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT}
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive
&& apt-get -y install --no-install-recommends vim wget redis-tools
ARG MONGO_CLI_VERSION=4.4
RUN wget -qO - https://www.mongodb.org/static/pgp/server-${MONGO_CLI_VERSION}.asc | sudo apt-key add -
RUN echo "deb http://repo.mongodb.org/apt/debian buster/mongodb-org/${MONGO_CLI_VERSION} main" | tee /etc/apt/sources.list.d/mongodb-org-${MONGO_CLI_VERSION}.list
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive
&& apt-get -y install --no-install-recommends mongodb-mongosh
&& apt-get clean -y && rm -rf /var/lib/apt/lists/*
RUN wget https://fastdl.mongodb.org/tools/db/mongodb-database-tools-debian11-x86_64-100.5.3.deb
RUN apt install ./mongodb-database-tools-*-100.5.3.deb
RUN su node -c "wget -O ~/.git-completion.bash https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash"
RUN su node -c "echo -e 'n# Git Completion' >> ~/.bashrc"
RUN su node -c "echo -e 'source ~/.git-completion.bashn' >> ~/.bashrc"
2
Answers
Try another platform for example x86_64
https://docs.docker.com/desktop/mac/apple-silicon/
On this line:
You’re trying to install a package named
mongodb-database-tools-debian11-x86_64-100.5.3.deb
that is for Intel processors (x64_64) in your ARM64 image. That’s not going to work.MongoDB doesn’t seem to offer a package for Debian on ARM64 on their download page. They do offer one for Ubuntu ARM64.
There doesn’t seem to be a variant of
javascript-node
that builds on Ubuntu 18 Bionic, however, I think you can keep on using this Debian 11 Bullseye variant, because the version of MongoDB-database-tools for Ubuntu 16 seems to install just fine:Build the image and test:
If you want this image to build on both x86 and ARM, check what architecture you’re on before downloading the .deb: