dockerfile-parse
dockerfile-parse copied to clipboard
Base image is incorrect when FROM statement has --platform
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
Hi, can I take this up?
yup, sure :)
Looking forward for this fix!