devtron icon indicating copy to clipboard operation
devtron copied to clipboard

Bug: Build Config - Docker file path gets preferred over custom docker file

Open yuvii opened this issue 1 year ago • 11 comments

📜 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.

image image

👍 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

AWS

🌍 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?

yuvii avatar Nov 04 '24 15:11 yuvii

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.

deepak-devtron avatar Nov 13 '24 14:11 deepak-devtron

@yuvii are you experiencing the same as @deepak-devtron or something different?

abhibhaw avatar Nov 14 '24 07:11 abhibhaw

@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

yuvii avatar Nov 21 '24 10:11 yuvii

Hey @yuvii we tried replicating this on latest devtron version but we didn't find the issue. Can you please confirm your devtron version?

abhibhaw avatar Dec 16 '24 08:12 abhibhaw

Also @yuvii if u can confirm in your case option B's dockerfile is being used for final build or option A

abhibhaw avatar Dec 16 '24 09:12 abhibhaw

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

yuvii avatar Dec 16 '24 14:12 yuvii

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 avatar Dec 30 '24 18:12 satyampsoni

@satyampsoni yes I've been able to recreate it. Just follow these steps:

  1. choose "I have a Dockerfile". input a fake path. Save.
  2. switch to "Create a Dockerfile" and save.
  3. 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.

yuvii avatar Jan 05 '25 08:01 yuvii

Hey @yuvii , I tried replicating this:

Image Image Image

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 avatar Feb 06 '25 06:02 abhibhaw

@abhibhaw I've made a video showcasing the issue: https://www.loom.com/share/c1d89c3ea3ce404988f405348d44680a?sid=48168098-3eb8-4355-92d4-dc507458b00d

yuvii avatar Feb 06 '25 09:02 yuvii

Thanks @yuvii got your concerns.

abhibhaw avatar Feb 06 '25 10:02 abhibhaw