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

mktemp present but non-functional #3108

Open
BeyondEvil opened this issue Apr 8, 2024 · 3 comments
Open

mktemp present but non-functional #3108

BeyondEvil opened this issue Apr 8, 2024 · 3 comments

Comments

@BeyondEvil
Copy link

BeyondEvil commented Apr 8, 2024

Actual behavior
mktemp is present in the image with execution bit set, but is non-functional:

mktemp: No such file or directory

Expected behavior
mktemp should work (or possibly be removed).

To Reproduce
Steps to reproduce the behavior:

❯ docker run -ti --rm --entrypoint "/bin/sh" gcr.io/kaniko-project/executor:v1.21.1-debug -c 'ls -la /busybox | grep mktemp'
-rwxr-xr-x  398 0        0          1312536 May 18  2023 mktemp

❯ docker run -ti --rm --entrypoint mktemp gcr.io/kaniko-project/executor:v1.21.1-debug                                      
mktemp: No such file or directory

❯ docker run -ti --rm --entrypoint "/busybox/mktemp" gcr.io/kaniko-project/executor:v1.21.1-debug                         
mktemp: No such file or directory

Additional Information
Digest: gcr.io/kaniko-project/executor@sha256:0818d281f155b9bb1b1f0704e55939b9c440b0155cbbf65b567ca19e19e20223

My system:

MacBook Pro M2 Max (Sonoma 14.2.1 (23C71))

❯ docker version                                             
Client:
 Cloud integration: v1.0.35+desktop.5
 Version:           24.0.6
 API version:       1.43
 Go version:        go1.20.7
 Git commit:        ed223bc
 Built:             Mon Sep  4 12:28:49 2023
 OS/Arch:           darwin/arm64
 Context:           desktop-linux

Server: Docker Desktop 4.24.2 (124339)
 Engine:
  Version:          24.0.6
  API version:      1.43 (minimum version 1.12)
  Go version:       go1.20.7
  Git commit:       1a79695
  Built:            Mon Sep  4 12:31:36 2023
  OS/Arch:          linux/arm64
  Experimental:     false
 containerd:
  Version:          1.6.22
  GitCommit:        8165feabfdfe38c65b599c4993d227328c231fca
 runc:
  Version:          1.1.8
  GitCommit:        v1.1.8-0-g82f18fe
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Triage Notes for the Maintainers

Description Yes/No
Please check if this a new feature you are proposing
  • - [No]
Please check if the build works in docker but not in kaniko
  • - [n/a]
Please check if this error is seen when you use --cache flag
  • - [n/a]
Please check if your dockerfile is a multistage dockerfile
  • - [n/a]
@JeromeJu
Copy link
Collaborator

JeromeJu commented Apr 11, 2024

Thanks for filing this @BeyondEvil , would you mind indicating which version of kaniko image are you using and could you try on previous release to find if this is a regression?

Also may I check with you why mktemp is regarded as present?

@BeyondEvil
Copy link
Author

Thanks for filing this @BeyondEvil , would you mind indicating which version of kaniko image are you using and could you try on previous release to find if this is a regression?

Version is v1.21.1-debug.

Sure, I'll do a regression test and get back to you.

Also may I check with you why mktemp is regarded as present?

Because ls -la lists it:

❯ docker run -ti --rm --entrypoint "/bin/sh" gcr.io/kaniko-project/executor:v1.21.1-debug -c 'ls -la /busybox | grep mktemp'
-rwxr-xr-x  398 0        0          1312536 May 18  2023 mktemp

@ahollmann
Copy link

ahollmann commented Apr 20, 2024

I've faced the same problem and this is my solution.

If no arguments are provided to mktemp it tries to create files at /tmp which does not exist in the kaniko container.

Create /tmp

# mktemp
mktemp: No such file or directory
# mkdir /tmp
# mktemp
/tmp/tmp.ieAGKD

Or

use

mktemp -p /existing_directory

Should work.

Having mktemp work out of the box by providing a /tmp folder would be a good thing.

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

3 participants