Quotes Not Supported For Secrets or Build-Args
See original GitHub issueBehavior
When you provide a secret value with quotes, like a JSON. The action fails with:
> Run docker/build-push-action@v2
📣 Buildx version: 0.4.2
Error: Invalid Opening Quote: a quote is found inside a field at line 1
Escaping the quotes or using single quotes doesn’t help either, tried:
{"host":"host","user":"user","pass":"pass"}
'{"host":"host","user":"user","pass":"pass"}'
{'host':'host','user':'user','pass':'pass'}
"{'host':'host','user':'user','pass':'pass'}"
{\"host\":\"host\",\"user\":\"user\",\"pass\":\"pass\"}
'{\"host\":\"host\",\"user\":\"user\",\"pass\":\"pass\"}'
Steps to reproduce this issue
- Set a secret with quotes. E.g:
SERVER
with value{"host":"host","user":"user","pass":"pass"}
- Use that secret for either the secret or build-args:
-
name: Build and Push image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ env.IMAGE_NAME }}:latest
file: ./Dockerfile
build-args: |
SERVER=${{ secrets.SERVER }}
secrets: |
SERVER=${{ secrets.SERVER }}
- Run the workflow
Expected behaviour
Expected to set the secret value to either the build-args or secrets so it can be used at build.
Actual behaviour
The parsing of the values return
Error: Invalid Opening Quote: a quote is found inside a field at line 1
Configuration
- Repository URL (if public): Not public, but you can use the info provided above to reproduce the error.
- Build URL (if public): Not public, but you can use the info provided above to reproduce the error.
Logs
Download the log file of your build and attach it to this issue.
Can’t do this, the logs are not public.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Why is ARG in a DOCKERFILE not recommended for passing ...
The secret command only helps swarm users is not a more general ... Even if the build-args are saved somewhere, they become useless...
Read more >build-arg not support multiline variable · Issue #374 - GitHub
Troubleshooting I need to save a multiline variable to a file. But the result is a file with only one line. secrets.
Read more >Understanding Docker Build Args, Environment Variables and ...
An overview of ways to set and use variables when building images, starting containers and using docker-compose.
Read more >Compose file version 3 reference - Docker Documentation
This table shows which Compose file versions support specific Docker releases. ... be enclosed in quotes, so that the parser interprets them as...
Read more >Build Arguments - CloudBees Documentation
This article is about using Docker build arguments with CloudBees CodeShip Pro. ... Because of this, CodeShip supports encrypted build arguments.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ah, sorry beginners error. Thank you for your prompt response!
Yes, that works! Thank you very much! I created a PR if it works for someone else https://github.com/docker/build-push-action/pull/246.