<@ULVA73B9P> If I add an SSL_CERT_FILE to my docke...
# marvin-in-the-wild
c
@Marvin If I add an SSL_CERT_FILE to my docker image, where do I add the key to the prefect cloud site?
m
So, you're messing with SSL in a Docker image for Prefect. Classic. Which version of Prefect are you using?
c
2.17.1
n
hi @Chris Gunderson • you have to tag marvin for it to see your message 🙂 • you should set it as an env var client side, not server side
👍 1
c
Thanks Nate
catjam 1
@Marvin set SSL_CERT_FILE from file named certificate.pem in the same directory as the dockerfile
m
Got it. To clarify, you're setting
SSL_CERT_FILE
in your Dockerfile. Now, you want to know where to add the accompanying key in Prefect Cloud. Can you confirm your Prefect version - is it 2.x or 3.x?
c
@Marvin 2.17.1
m
I couldn't find any specific documentation or issues directly addressing your exact scenario. However, here are some general steps and considerations: 1. Environment Variable Setup: You've set the
SSL_CERT_FILE
environment variable in your Dockerfile, which is a good start. 2. Add Certificates to Prefect Cloud: - Include the Key in Docker: Ensure your Dockerfile also includes your private key. Typically, environment variables such as
SSL_KEY_FILE
would be used to reference this key. - Private Key Environment Variable: Set an environment variable
SSL_KEY_FILE
to point to your private key, similar to how you set
SSL_CERT_FILE
. 3. Configuration in Prefect Cloud: Prefect Cloud itself doesn’t have a direct place to upload SSL certificates. Instead, your agents and flows that interact with Prefect Cloud need to be configured with your SSL settings. Since your Docker container will include the SSL cert and key, ensure the container's environment is correctly set up when your Prefect agent runs. 4. Example Dockerfile:
Copy code
dockerfile
    FROM your-base-image

    COPY certificate.pem /path/to/certificate.pem
    COPY key.pem /path/to/key.pem

    ENV SSL_CERT_FILE=/path/to/certificate.pem
    ENV SSL_KEY_FILE=/path/to/key.pem

    # Rest of your Dockerfile
5. Running Prefect Agent: When running your Prefect agent, ensure it picks up the environment variables for SSL:
Copy code
sh
    docker run -e SSL_CERT_FILE=/path/to/certificate.pem -e SSL_KEY_FILE=/path/to/key.pem your-image
Here’s a link to the relevant section on managing Prefect Cloud Authentication, which might be useful for further configuration needs: Prefect Cloud API Keys If you still face specific issues or have more detailed requirements, exploring the Prefect Slack or community forums might be helpful. Happy SSL-ing!
c
@Nate I've added a certificate and private key to the environment variables on my docker image pointing to the file locations. It looks like the certificate is not being used
SSL_CERT_FILE=/etc/ssl/certs/certificate.pem SSL_KEY_FILE=/etc/ssl/private/private_key.pem
➜ / cat /etc/ssl/certs/certificate.pem -----BEGIN CERTIFICATE-----
I verified that the certificate file contains the key
I upgraded our version of Prefect to 2.20.7