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

Error when ENTRYPOINT is set to empty array #6707

Closed
sbienkow-ninja opened this issue Oct 8, 2021 · 2 comments
Closed

Error when ENTRYPOINT is set to empty array #6707

sbienkow-ninja opened this issue Oct 8, 2021 · 2 comments
Labels
area/build kind/bug Something isn't working priority/p2 May take a couple of releases

Comments

@sbienkow-ninja
Copy link

Expected behavior

When I set ENTRYPOINT to empty array, skaffold parses it correctly and the image is built without entrypoint (removing entrypoint from parent image).

FROM someimage
ENTRYPOINT []

Actual behavior

When checking cache, the following error is thrown:

getting hash for artifact "<IMAGE>": getting dependencies for "<IMAGE>": parsing dockerfile "<PATH>/Dockerfile": dockerfile parse error line 12: ENTRYPOINT requires at least one argument

Information

  • Skaffold version: v1.33.0
  • Operating system: Arch
  • Installed via: yay (AUR package skaffold-bin)
  • Contents of skaffold.yaml:
apiVersion: skaffold/v2beta23
kind: Config
build:
  local:
    useBuildkit: true
    push: false
  artifacts:
    - image: example
      context: ./example/

Steps to reproduce the behavior

  1. Create following setup:
# 11:33:58 sbienkow@sebixE595 /tmp/skaffold $ :)
tree
.
├── example
│   └── Dockerfile
└── skaffold.yaml

1 directory, 2 files
# 11:34:11 sbienkow@sebixE595 /tmp/skaffold $ :)
cat skaffold.yaml
apiVersion: skaffold/v2beta23
kind: Config
build:
  local:
    useBuildkit: true
    push: false
  artifacts:
    - image: example
      context: ./example/
# 11:34:13 sbienkow@sebixE595 /tmp/skaffold $ :)
cat example/Dockerfile
FROM ubuntu
ENTRYPOINT []
  1. Run skaffold build
$ skaffold build -vdebug
DEBU[0000] skaffold API not starting as it's not requested  subtask=-1 task=DevLoop
INFO[0000] Skaffold &{Version:v1.33.0 ConfigVersion:skaffold/v2beta24 GitVersion: GitCommit:251c0406b3f9ef149cfa084d912874fd080e1e97 BuildDate:2021-10-07T19:30:49Z GoVersion:go1.14.14 Compiler:gc Platform:linux/amd64 User:}  subtask=-1 task=DevLoop
INFO[0000] Loaded Skaffold defaults from "/home/sbienkow/.skaffold/config"  subtask=-1 task=DevLoop
DEBU[0000] config version out of date: upgrading to latest "skaffold/v2beta24"  subtask=-1 task=DevLoop
DEBU[0000] parsed 1 configs from configuration file /tmp/skaffold/skaffold.yaml  subtask=-1 task=DevLoop
DEBU[0000] Defaulting deploy type to kubectl             subtask=-1 task=DevLoop
INFO[0000] Using kubectl context: kind-kind              subtask=-1 task=DevLoop
DEBU[0000] Running command: [minikube version --output=json]  subtask=-1 task=DevLoop
DEBU[0000] Command output: [{"commit":"0a0ad764652082477c00d51d2475284b5d39ceed-dirty","minikubeVersion":"v1.23.2"}
]  subtask=-1 task=DevLoop
DEBU[0000] Running command: [/usr/bin/minikube profile list -o json --user=skaffold]  subtask=-1 task=DevLoop
DEBU[0000] setting Docker user agent to skaffold-v1.33.0  subtask=-1 task=DevLoop
DEBU[0000] Using builder: local                          subtask=-1 task=DevLoop
INFO[0000] build concurrency first set to 1 parsed from *local.Builder[0]  subtask=-1 task=DevLoop
INFO[0000] final build concurrency value is 1            subtask=-1 task=DevLoop
Generating tags...
 - example -> DEBU[0000] Running command: [git describe --tags --always]  subtask=-1 task=Build
DEBU[0000] generating tag: unable to find git commit: running [git describe --tags --always]
 - stdout: ""
 - stderr: "fatal: not a git repository (or any parent up to mount point /)\nStopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).\n"
 - cause: exit status 128  subtask=example task=Build
DEBU[0000] Using a fall-back tagger                      subtask=example task=Build
example:latest
Some taggers failed. Rerun with -vdebug for errors.
INFO[0000] Tags generated in 1.826506ms                  subtask=-1 task=Build
Checking cache...
 - example: Error checking cache.
DEBU[0000] Running command: [tput colors]                subtask=-1 task=DevLoop
DEBU[0000] Command output: [256
]                        subtask=-1 task=DevLoop
getting hash for artifact "example": getting dependencies for "example": parsing dockerfile "/tmp/skaffold/example/Dockerfile": dockerfile parse error line 2: ENTRYPOINT requires at least one argument
DEBU[0000] exporting metrics                             subtask=-1 task=DevLoop
DEBU[0001] metrics uploading complete in 800.135893ms    subtask=-1 task=DevLoop
@gsquared94 gsquared94 added area/build kind/bug Something isn't working priority/p2 May take a couple of releases labels Oct 11, 2021
@nkubala
Copy link
Contributor

nkubala commented Oct 29, 2021

@sbienkow-ninja thanks for the issue. this looks like an issue with moby/buildkit, which we're using to validate Dockerfiles before parsing them as part of our cache check. I opened moby/buildkit#2436 - if/when that gets fixed we'll pick up the patch for the following skaffold release.

@nkubala nkubala closed this as completed Oct 29, 2021
@lsoica
Copy link

lsoica commented Jan 20, 2022

This is still an issue with skaffold although in buildkit it was addressed long time back

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/build kind/bug Something isn't working priority/p2 May take a couple of releases
Projects
None yet
Development

No branches or pull requests

4 participants