-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
When using podman kube play, allow to specify Dockerfile/build folder location #12485
Comments
SGTM, But the Dockerfile and context directory are per image, I believe. How should it be handled if there is more then one image? |
@baude WDYT? |
Yep, they are per image. I'm currently trying to learn podman/k8s and migrate off Docker so I'm not 100% sure but the yaml spec doesn't look like there can ever be more than 1 image per container |
Right, but what if you have two containers in a Pod? Then you would have two images to build potentially. |
yeah this gets kind of ugly quickly, which is why I asked @BernhardPosselt to make the issue. could we allow the context dir to be set in addition to the subdir. it would have to then be for all images. the other idea i was chewing on is some sort of k8s annotations ... but we cannoot auto-gen those. it would all be manual. k8s would ignore it |
Wouldn't it be possible to attach that build information on the container level itself? Otherwise I actually wouldn't mind going for something like annotations that define per image where my Dockerfile and context directory are. As for the use case: looked into it a bit more but then realized that I can't even move it around in the repository because I would break the deployment scripts (which I can't edit, don't ask why xD) as well. So basically I really need a way to be able to build from the same location where the pod yaml is in, which is currently only possible using a docker-compose.yml. |
Currently we look for the subdirs with the image name. We could point to a different directory, which also had the image named subdirs. But that is not really what you want. |
I am pretty sure kubernetes does not supports this but this could be a podman only [RFE]. Developers use tools like If this is a podman only I personally think best approach to solve this problem without tampering with
apiVersion: v1
kind: Pod
metadata:
name: mypod
annotations:
podman-build: "{image: <imagename>, context: </path/context>, containerfile: <path/to/containerfile>}"
podman-build: "{image: <imagename2>, context: </path/context2>, containerfile: <path/to/containerfile2>}"
|
Friendly ping. @BernhardPosselt would the build annotations as outlined above satisfy your needs? |
Yes. |
Great, thanks! @flouthoc, do you want to give it a shot and have some cycles? I think this could be a great feature for Podman 4.0. |
@vrothberg Sure I'd love to. |
A friendly reminder that this issue had no activity for 30 days. |
This option was requested so that users could specify alternate locations to find context directories for each image build. It requites the --build option to be set. Partion Fix: containers#12485 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This option was requested so that users could specify alternate locations to find context directories for each image build. It requites the --build option to be set. Partion Fix: containers#12485 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Did this feature get implemented? The PR listed here doesn't seem to allow specific builds per image, only one |
Open a separate Issue for that. |
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind feature
Description
podman play kube allows you to build a container from a local container file by using a subdirectory as the image value.
This is fine if you set up a new project, but if you retroactively want to enable in your project, it will require a giant commit, possibly moving thousands of files into a subfolder, breaking peoples ide setups and potentially builds.
The main issue here is that Dockerfiles/Containerfiles can not reference directories that are above their current folder; the following line can not be built:
This only leaves you with moving everything to a sub directory
docker-compose solves this by being able to specify the build directory and Dockerfile location whereas the following is not possible using the kube configuration:
The text was updated successfully, but these errors were encountered: