action-kaniko icon indicating copy to clipboard operation
action-kaniko copied to clipboard

extra_args example

Open atassis opened this issue 4 years ago • 3 comments

It would be nice to provide examples of extra_args usage approaches

atassis avatar Jan 10 '21 12:01 atassis

Has anyone figured out how to use extra_args? Currently, I have no idea how to use it and without these extra_args, I am not able to use action-kaniko

cbtum avatar Jan 28 '22 08:01 cbtum

here's an example of how extra_args works:

    - name: Kaniko build
      uses: aevea/action-kaniko@master
      with:
        image: quay.io/sandromodarelli/image
        tag: 1.0.0
        registry: quay.io
        username: ${{ secrets.QUAYIO_ACCESS_USERNAME }}
        password: ${{ secrets.QUAYIO_ACCESS_PASSWORD }}
        extra_args: --build-arg SECRET_USER=${{ secrets.SECRET_USER }} --build-arg SECRET_TOKEN=${{ secrets.SECRET_TOKEN }}

i'm using this to build a Dockerfile like:

FROM python:3.6-alpine
ARG SECRET_USER
ARG SECRET_TOKEN
...

sandromodarelli avatar Mar 25 '22 14:03 sandromodarelli

Can extra_args not be used with cache?

[Docker build/docker]   🐳  docker run image=act-aevea-action-kaniko-master-dockeraction:latest platform= entrypoint=[] cmd=[] network="container:act-Docker-build-docker-b94a3e5b6e352c0c514b5e705cc1f6eb9dfa89426c8dd5d70fd20351d21ecc0f"
| Running kaniko command /kaniko/executor --cache=true --context /home/mcampbell/github/coreweave/cloud-console/. --dockerfile ./Dockerfile  --digest-file /kaniko/digest --image-name-tag-with-digest-file=/kaniko/image-tag-digest --destination registry.gitlab.com/coreweave/cloud-console:mc-65-kaniko-build-github-action $KANIKO_ADDTL_ARGS --reproducible --force
| Error: invalid argument "true --cache-repo=${CACHE_REGISTRY_REPO} --skip-tls-verify --skip-unused-stages=true --insecure" for "--cache-run-layers" flag: strconv.ParseBool: parsing "true --cache-repo=${CACHE_REGISTRY_REPO} --skip-tls-verify --skip-unused-stages=true --insecure": invalid syntax

mecampbellsoup avatar May 01 '24 18:05 mecampbellsoup