Dockerfile parse error line 5: unknown instruction: RPM
Published
Updated
This error can happen when you try to run a Docker image with a CPU architecture that differs from the host operating system. For example, you are trying to run an Alpine 64 Linux image on x86 Oracle Linux.
To solve this, add the following ARCH_DIR and ARCH_IMG arguments to your Docker build file:
ARG ARCH_DIR=x86_64
ARG ARCH_IMG=centos
...
FROM alpine:3.9
MAINTAINER John Smith
RUN apk --update add ...
When you run your Docker build, be sure to include these architecture arguments:
docker build --build-arg ARCH_DIR=x86_64 --build-arg ARCH_IMG=docker.io/centos -f ./MyImage.docker -t TAGNAME/VERSION:0.0.1 ./build/