Is it possible to use GitHub Action inputs inside the Dockerfile?

  docker, github-actions

I created a GitHub action and am passing input arguments to the action. I am using these arguments in a bash script, which is being called by the Dockerfile. However, it is possible to use any of these inputs in the Dockerfile?

Specifically I am trying to make the python version a variable input. The Dockerfile is:

FROM python:3
RUN pip install flake8
COPY entrypoint.sh /
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

Where I want the first line to be

FROM python:<github_action_input_arg>

Source: Docker Questions

LEAVE A COMMENT