Hello I have an ARM server, so I need to compile the image I have to ARM, but I have this error:
—> [Warning] The requested image’s platform (linux/arm64) does not match the detected host platform (linux/amd64) and no specific platform was requested
—> Running in a27002134666
standard_init_linux.go:228: exec user process caused: exec format error
This is my code (DOCKERFILE):
FROM --platform=arm64 node:14.5.0-alpine
set working directory
RUN mkdir /usr/src/app
WORKDIR /usr/src/app
add /usr/src/app/node_modules/.bin
to $PATH
ENV PATH /usr/src/app/node_modules/.bin:$PATH
install and cache app dependencies
COPY package.json /usr/src/app/package.json
RUN npm install
RUN npm install -g @angular/cli@11.0.3
add app
COPY . /usr/src/app
#generate build
RUN npm run build
base image
FROM --platform=arm64 nginx:latest
copy artifact build from the ‘build environment’
COPY --from=builder /usr/src/app/dist/fronted /usr/share/nginx/html
COPY default.conf /etc/nginx/conf.d/default.conf
expose port 80
EXPOSE 80
run nginx
CMD [“nginx”, “-g”, “daemon off;”]