Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass user/project variables to Docker build process #18568

Open
JuJup opened this issue Aug 22, 2023 · 3 comments
Open

Pass user/project variables to Docker build process #18568

JuJup opened this issue Aug 22, 2023 · 3 comments

Comments

@JuJup
Copy link

JuJup commented Aug 22, 2023

Is your feature request related to a problem? Please describe

I'm using a Docker Image based on one of your Base Images. I install a few tools and stuff, but now I want to download some files and custom tools from a S3 bucket. I'd like to avoid doing this in a init script, as those files are rarely changing. So putting them into my dockerfile seems logical for me.
However, for this I need to pass credentials as arguments to my docker build, which works in a workspace, but afaik not during the automatic build of the containers.

Describe the behaviour you'd like

I'd like to access my project and user specific variables during the docker build.

Describe alternatives you've considered

I know this solution for integration with doppler (https://www.gitpod.io/blog/dynamic-aws-development-environments-with-doppler-and-gitpod), which is super useful but doesn't help in my case.
Maybe I missed something, so in case this already works please let me know.

@axonasif
Copy link
Member

Hi @JuJup, you could build the docker image manually inside a running Gitpod workspace. Then you push the image to your dockerhub account as a private image.

Here are some docs on how to use a private image: https://www.gitpod.io/docs/configure/workspaces/workspace-image#use-a-private-docker-image

but now I want to download some files and custom tools from a S3 bucket.

You may use a script to download those files in a temporary location (e.g. /tmp dir within a running Gitpod workspace) and in your dockerfile use a COPY ... instruction.

Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the meta: stale This issue/PR is stale and will be closed soon label May 23, 2024
@JuJup
Copy link
Author

JuJup commented May 29, 2024

@axonasif, thanks for the suggestion. However, this bypasses all the logic for creating base images, that Gitpod already does for me and which works good. So creating the image by myself in a workspace can't be a solution, as it doesn't scale well and a manual action doesn't really fit in this automated workspace management. The idea is simply to pass variables to the build process.

@github-actions github-actions bot removed the meta: stale This issue/PR is stale and will be closed soon label May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants