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

Issues with image build in 2.5 orb #193

Closed
srinath92 opened this issue Jul 9, 2024 · 3 comments
Closed

Issues with image build in 2.5 orb #193

srinath92 opened this issue Jul 9, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@srinath92
Copy link

Orb version

2.5.0

What happened

We use this orb via gcp-gcr@0.16.3
The issue I see is with the build arguments passed to the build command and there by to build.sh.
Following is one of our jobs
`

docker_build_and_push_image:
name: docker_build_and_push_image_test
requires:
- init
service_id: test-service-id
dockerfile: docker/php/containers/php-cron/Dockerfile
image: test
extra_build_args: --build-arg=IMAGE_NAME=test --build-arg=CRON_COMMAND='/usr/local/bin/php /app/bin/console business:abc:xyz'
tag: latest
context:
- artifactory
`
So, if you look at the extra_build_args: arg in the above, it has an arg that is actually a command I need to be part of the image. But when trying to build the image via circle ci, I get the below error.

**ERROR: "docker buildx build" requires exactly 1 argument.
See 'docker buildx build --help'.

Usage: docker buildx build [OPTIONS] PATH | URL | -

Start a build

Exited with code exit status 1**

When investigated a bit more, it looks like the shell interpreter is splitting the argument into something like --build-arg=CRON_COMMAND='/usr/local/bin/php' /app/bin/console 'business:abc:xyz'

We need to upgrade the orb version as circle ci is looking to remove the deprecated images.

Expected behavior

The image should be built with the args passed above, as it used to be when using docker-orb@1.5

@srinath92
Copy link
Author

srinath92 commented Jul 9, 2024

This seems to be happening due to the quotes missing here

docker build ${build_args[*]}
. I do understand that the quotes are intentionally missed to enable word splitting, but this is causing problems with my use case. Are there any suggestions around this?

@marboledacci
Copy link
Contributor

Your issue should be solved on this version

@marboledacci
Copy link
Contributor

The new version of docker orb was integrated in version 0.16.4 of the gcp-gcr orb.
I will close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants