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

multiple export point #1485

Closed
kenotsolutions opened this issue May 11, 2020 · 7 comments
Closed

multiple export point #1485

kenotsolutions opened this issue May 11, 2020 · 7 comments

Comments

@kenotsolutions
Copy link

Hi,

Does buildkit support multiple output points something like below lines?
--output type=image,name=prod.docker.io/username/image,push=true
--output type=image,name=test.docker.io/username/image,push=true \

When I try to do add multiple outputs it gives the error.

error: currently only single Exports can be specified

Is there any other way to do that?

--output type=image,"
name=prod.docker.io/abc:3, name=test.docker.io/abc:3"

exports only prod.docker.io

Thanks

@tonistiigi
Copy link
Member

Multiple outputs are not allowed atm but for your case you can just specify multiple values for name, separated by a comma. Note that in cli you also need to quote the value because the format is csv. #807 (comment)

@ties-s
Copy link

ties-s commented Aug 19, 2020

@tonistiigi could you provide an example for the quotes? Do I quote the whole value? Or every name value separately?

@nirname
Copy link

nirname commented Sep 10, 2020

I dare say the correct format is:

--output type=image,\"name=reg1/img:1,reg2/img:2\",push=true

Note, that you have to place quotes around "name=..." and escape them \"name=...\". Then replace ellipsis with your comma separated reg/img:tag entries.

This works for GithubActions and worked for GitlabCI as well, as was described in the answer that helped me

@ties-s
Copy link

ties-s commented Apr 2, 2021

Using --output type=image,\"name=$IMAGE:$TAG,$IMAGE:$CI_COMMIT_SHA\",push=true (variables are defined) I get error: failed to parse csv secret: parse error on line 1, column 13: bare " in non-quoted-field

@adriannieto-attechnest
Copy link

Same issue here

+ buildctl-daemonless.sh build '--frontend=dockerfile.v0' --local 'context=.' --local 'dockerfile=.' --opt 'filename=./Dockerfile.3.10' --import-cache 'type=local,src=/shared-cache/common/docker' --export-cache 'type=local,dest=/shared-cache/common/docker' --output 'type=image,name="hxxxx/python-runtime:1.0.1-PLAT-513-draft-new-change.1-3043a3d-202306281687936845",push=false'

error: parse error on line 1, column 17: bare " in non-quoted-field

``

@cmorinupgrade
Copy link

cmorinupgrade commented Jul 12, 2023

@ties-s @adriannieto-attechnest

Did you find a solution to your problem? I got the exact same issue.

@adriannieto-attechnest
Copy link

DOCKER_PUSH_TARGETS="$CI_DOCKER_IMAGE_DESTINATION:$CI_DOCKER_IMAGE_TAG-$GIT_VERSION-$TIMESTAMP,$CI_DOCKER_IMAGE_DESTINATION:$CI_DOCKER_IMAGE_TAG"

buildctl-daemonless.sh build \
    --frontend=dockerfile.v0 \
    --local context=. \
    --local dockerfile=. \
    --opt filename=./$CI_DOCKERFILE_NAME $CI_DOCKER_BUILDKIT_EXTRA_OPTS \
    --import-cache type=local,src=$CI_DOCKER_BUILDKIT_CACHE_PATH \
    --export-cache type=local,dest=$CI_DOCKER_BUILDKIT_CACHE_PATH \
    --output type=image,\"name=$DOCKER_PUSH_TARGETS\",push=$CI_BUILD_DOCKER_ENABLE_PUSH

This is now working for us

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

6 participants