dockerfile-parse icon indicating copy to clipboard operation
dockerfile-parse copied to clipboard

Base image is incorrect when FROM statement has --platform

Open rodneyxr opened this issue 4 years ago • 3 comments

From the docker docs it says Dockerfile supports --platform=<platform> however when we try to reference the baseimage property of the parser, it reports the base image as the --platform=<platform> string.

Using the following Dockerfile:

FROM --platform=linux/amd64 docker.io/library/centos:latest

And using the following code:

from dockerfile_parse import DockerfileParser

parser = DockerfileParser(fileobj=containerfile)
print(parser.baseimage)

Here is my result

--platform=linux/amd64

rodneyxr avatar Sep 08 '21 23:09 rodneyxr

Hi, can I take this up?

ElijahAhianyo avatar Mar 09 '22 09:03 ElijahAhianyo

yup, sure :)

MartinBasti avatar Mar 09 '22 12:03 MartinBasti

Looking forward for this fix!

flyingh0rse avatar Oct 18 '22 16:10 flyingh0rse