Bug: Build Config - Docker file path gets preferred over custom docker file
📜 Description
If there's a dockerfile path configured in the build stage, if you switch to "Create Dockerfile" option the deployment would still try to build from the file path provided.
👟 Reproduction steps
Create an app, in the build configuration enter a path for a Dockerfile, then switch to "Create Dockerfile". The deployment would then look for the file specified in the path, ignoring the created dockerfile.
👍 Expected behavior
The deployment should use the selected dockerfile, regardless if there are other values available
👎 Actual Behavior
Devtron picks the docker image from the path if a value is provided, ignoring what is actively selected.
☸ Kubernetes version
EKS 1.30
Cloud provider
🌍 Browser
Opera
🧱 Your Environment
No response
✅ Proposed Solution
No response
👀 Have you spent some time to check if this issue has been raised before?
- [X] I checked and didn't find any similar issue
🏢 Have you read the Code of Conduct?
- [X] I have read the Code of Conduct
Hi Yuval, The custom Dockerfile feature is working as expected. However, to run the docker build command, the content needs to be saved in a file. Currently, the path is being picked from the 'I have Dockerfile' tab, which may not provide the best user experience. We appreciate your feedback and will consider this improvement in an upcoming release.
@yuvii are you experiencing the same as @deepak-devtron or something different?
@abhibhaw no. He didn't understand my issue. It's not a complaint about user experience, this is a genuine bug. I inputted a path to "I have a Dockerfile" option (let's call it option A), then I switched over to "Create Dockerfile" (option B). When I tried to run the pipeline, the build still tried to use the path from option A. It was only when I deleted the value from the path that it would use the created Dockerfile. It seems like the pipeline will always pick option A if there's any value in the path at all regardless if I have marked option B as my choice selection. If I'm selecting option B, it should never use option A even if it has values
Hey @yuvii we tried replicating this on latest devtron version but we didn't find the issue. Can you please confirm your devtron version?
Also @yuvii if u can confirm in your case option B's dockerfile is being used for final build or option A
Also @yuvii if u can confirm in your case option B's dockerfile is being used for final build or option A
I've since updated the version, I haven't tried recreating this issue,but I can try and check and see if it's still relevant
Hi @yuvii, have you had a chance to replicate this issue? Does it still persist, or do you need any further assistance from us?
@satyampsoni yes I've been able to recreate it. Just follow these steps:
- choose "I have a Dockerfile". input a fake path. Save.
- switch to "Create a Dockerfile" and save.
- Run build.
Even though "Create" option is selected, when running the build it looks for the Dockerfile path set in the first option that is currently not active.
Hey @yuvii , I tried replicating this:
Seems like it's working for me. Am I missing something? If you're still facing this issue, please help me with some more details, so that I can get this debugged and fixed. (A video replicating the issue may be helpful)
@abhibhaw I've made a video showcasing the issue: https://www.loom.com/share/c1d89c3ea3ce404988f405348d44680a?sid=48168098-3eb8-4355-92d4-dc507458b00d
Thanks @yuvii got your concerns.