I have a service which works with docker, where I previously created a file type variable with scope of the environment, so in my docker file I am able to access my variable that returns the path but when I want to copy the file in my dockerfile it throws me a mistake. “/tmp/parameters.yml”: not found
Create file type variable with the key “APP_PARAMETERS_FILE”, the path “/tmp/parameters.yml” and the value
hello=world
world=hello
In the dockerfile the following:
FROM php:5.6-apache as base
ARG APP_PARAMETERS_FILE
RUN echo ${APP_PARAMETERS_FILE}
COPY ${APP_PARAMETERS_FILE} ./app_parameters.yml
RUN cat ./app_parameters.yml
The build is failing because the file /tmp/parameters.yml doesn’t exist in your repository: the path of your file environment variable is injected, but not its content.
Hello,
We have a legacy project with symfony in which it needs a yaml file where the parameters and secrets are stored per environment.
I am looking for workarounds to be able to move forward while I understand this since we are trying to migrate our service to qovery as soon as possible, even so I created the variable again and retried the deployment to share with you, hoping you can guide me.
Here is the link of my enviroment/service/deployment.
File variables are not visible when your dockerfile is building, only the path is injected, i.e in your current deployment /tmp/parameters.yml.
Under the hood, the file variable is a secret on kubernetes side accessible through its path.
What you need to achieve is to indicate the path of your file variable to your application at runtime. This means you need to provide the path of your file variable to your underlying application at startup: you can simply remove your COPY instruction from your Dockerfile as the file will be accessible at runtime.