Hello, I am just testing a Docker recipe which con...
# ask-community
c
Hello, I am just testing a Docker recipe which contains the docker command
RUN prefect auth login --key ${PREFECT__CLOUD__API_KEY}
where `PREFECT__CLOUD__API_KEY`` is an ARG. But I'm getting this error:
Copy code
#13 1.047 Your API key is set in the Prefect config instead of with the CLI. To log in with the CLI, remove the config key `prefect.cloud.api_key`
k
Hey @Chris L., does that Docker contain the
config.toml
and does it have some authentication key already?
What happens when you do
prefect auth logout
c
Copy code
> [ 9/10] RUN prefect auth logout:
#13 1.232 Your API key is set in the Prefect config instead of with the CLI. To log out, remove the config key `prefect.cloud.api_key`
The Docker does not contain the
config.toml
, I am unsure if the image contains
config.toml
. Does prefect create it upon
pip install
? Anyhow, I shall create one but where should I copy it into the image? Thanks Kevin
k
home_directory/.prefect
is where you want to put it. are you sure you aren’t already authenticated in that image?
c
Hi Kevin, I will need to investigate further. I've set ${PREFECT__CLOUD__API_KEY} as an
ARG
, so I am authenticated during the build-stage but not in the running container.
Let me try to set
ARG
to a different name than PREFECT__CLOUD__API_KEY
k
You might have an env variable also
PREFECT__CLOUD__API_KEY
in the container which prevents us to setting it
c
Hello, Kevin I got this to work. Just wondering if there is a gist anywhere for a production ready Dockerfile (with authentication involved). Unsure if this is the most secure way to authenticate to cloud during the build stage.
k
I haven’t seen any. This is about authenticating an agent running in a container right? I haven’t seen the
Dockerfiles
of other people, but I’ll keep this in mind and ask next time I see one.
c
Thank you again for all the help! I'm not a devops person by trade, so I apologize in advance for any poorly defined questions and comments.
Actually, this is about authenticating for a streamlit app running in a container. I need to pull some PrefectSecrets into the app and run flows from inside the app
k
No worries at all! Am not either myself. 😅
c
So yes! In a way, the streamlit app is the "agent"
k
Ahh I see. Ok will keep that in mind.