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

Using --context cause flatten folders #2235

Open
ipa-rwu opened this issue Sep 2, 2022 · 0 comments
Open

Using --context cause flatten folders #2235

ipa-rwu opened this issue Sep 2, 2022 · 0 comments
Labels
area/filesystems For all bugs related to kaniko container filesystems (mounting issues etc) area/permissions area/uid categorized differs-from-docker kind/bug Something isn't working priority/p0 Highest priority. Break user flow. We are actively looking at delivering it. priority/p1 Basic need feature compatibility with docker build. we should be working on this next. works-with-docker

Comments

@ipa-rwu
Copy link

ipa-rwu commented Sep 2, 2022

Actual behavior
Using --context causing flatten all the folders

To Reproduce
Steps to reproduce the behavior:

I am working on a gitlab repository. The folder structure looks like the following:

% tree
.
├── Dockerfile
├── README.md
├── folder_1
│   └── folder_1_1
│      └── folder_1_1_1
├── folder_2
│   └── folder_2_1
│      └── folder_2_1_1
└── .gitlab-ci.yaml

I use a command as follows in gitlab-ci.yaml

- /kaniko/executor
      --context "${CI_PROJECT_DIR}"

My dockerfile looks like as follows:

COPY . /root/ws/src/pkg/

Then I found out kaniko flatten folders, so in my root folder, it looks like:

% tree
.
├── Dockerfile
├── README.md
├── folder_1
│   └── folder_1_1
│      └── folder_1_1_1
├── folder_2
│   └── folder_2_1
│      └── folder_2_1_1
└── folder_1_1
└── folder_1_1_1
└── folder_2_1
└── folder_2_1_1
└── .gitlab-ci.yaml

So when I use COPY . /root/ws/src/pkg/, it will copy replicated folder.

Expected behavior
I expect it will keep the folder structure as the repository, and copy it into docker workspace

Triage Notes for the Maintainers

Description Yes/No
Please check if this a new feature you are proposing
Please check if the build works in docker but not in kaniko
Please check if this error is seen when you use --cache flag
Please check if your dockerfile is a multistage dockerfile
@aaron-prindle aaron-prindle added kind/bug Something isn't working area/filesystems For all bugs related to kaniko container filesystems (mounting issues etc) priority/p1 Basic need feature compatibility with docker build. we should be working on this next. differs-from-docker works-with-docker priority/p0 Highest priority. Break user flow. We are actively looking at delivering it. area/uid area/permissions categorized labels Jun 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/filesystems For all bugs related to kaniko container filesystems (mounting issues etc) area/permissions area/uid categorized differs-from-docker kind/bug Something isn't working priority/p0 Highest priority. Break user flow. We are actively looking at delivering it. priority/p1 Basic need feature compatibility with docker build. we should be working on this next. works-with-docker
Projects
None yet
Development

No branches or pull requests

2 participants