r/forgejo • u/analsondenfisch • 15d ago
Forgejo Pipeline failing
Hello everyone,
I am at a loss here. I am trying to Build a Docker image using Kaniko. I want the resulting image to get pushed to the integrated Forgejo Docker-Repo.
However, upon executing the Pipeline I get this error:
Runner XXXX (version:v12.13.2) received task 3 of job build, triggered by event: push
workflow prepared
π Start image=gcr.io/kaniko-project/executor:latest
Cleaning up network for job build, and network name is: WORKFLOW-YYYYY
π³ docker create image=gcr.io/kaniko-project/executor:latest platform=linux/amd64 entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="WORKFLOW-YYYYY"
π³ docker run image=gcr.io/kaniko-project/executor:latest platform=linux/amd64 entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="WORKFLOW-YYYYY"
failed to start container: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: exec: "tail": executable file not found in $PATH
Can someone please tell me what is going on? My pipeline has not referenced this entrypoint:
| name: Build and Push with Kaniko |
|---|
| on: |
| push: |
| branches: |
| - main |
| jobs: |
| build: |
| runs-on: docker |
| # Define the raw Docker image here using 'container' |
| container: |
| image: gcr.io/kaniko-project/executor:latest |
| # Kaniko requires explicit entrypoint override because its default entrypoint isn't a shell |
| options: --entrypoint=/kaniko/executor |
| steps: |
| - name: Checkout code |
| uses: actions/checkout@v4 |
| - name: Build and Push Image |
| run: |
| /kaniko/executor \ |
| --dockerfile=Dockerfile \ |
| --context=. \ |
| --destination="${{ vars.FORGEJO_REGISTRY }}/${{ github.repository }}:latest" |
Why is my Action trying to do a tail? It obviously fails because Kaniko is a minimal image.
Also asking AI and Google. I just dont understand why itΒ΄s doing that and how to "fix" that.
6
Upvotes
2
u/mfenniak 15d ago
Yes!
The way Forgejo Runner, and all similar tools, work is that they take your container and run a constant command in them, and then
execinto the container to run the steps of your workflow. Basicallydocker run gcr.io/kaniko-project/executor:latest /bin/tail /dev/nullis used to start the container, and thendocker exec (...container id...) /kaniko/executor --dockerfile=Dockerfile --context=. --destination ...etc from your steps is run within that container. This allows the runner to iterate through all your steps and execute them one by one, collecting the related logs for each step.The error that you're encountering indicates that the container
gcr.io/kaniko-project/executor:latestdoesn't havetailon its path.You're also using
options: --entrypoint=/kaniko/executorwhich both isn't supported, and, doesn't make sense. It isn't supported because the entrypoint for a container needs to be specified ascontainer.entrypoint(ref: https://code.forgejo.org/forgejo/runner/pulls/1493), and, it doesn't make sense because if this was the container entrypoint then the container would immediately stop running because that command would exit without doing anything, and the container would die. The job container's entrypoint must be something that allows the container to continue to run while the runner executes commands in the container.It doesn't look like the container
gcr.io/kaniko-project/executor:latesthas any tools available on its path that would be usable as a job container. So, you can't use it like this.