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

added &> /dev/null to azdo dockerfile #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ImadKirat
Copy link

Purpose

I faced an issue when calling this script in Terraform using the local-exec provisioner where some of the output of the 4th step could not be parsed due to a missing encoding setting in Terraform.

The only thing i changed is redirecting the output of this step to /dev/null. As such, the output of the 4th step when calling this in a script does not go trough terraform (or anything really) so no parsing issues can occur.

Does this introduce a breaking change?

[ ] Yes
[X] No

Pull Request Type

What kind of change does this Pull Request introduce?

[X] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[X] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[ ] Other... Please describe:

How to Test

What to Check

No output from the 4the step

Other Information

Below you can find the way I call the dockerfile in Terraform. It invokes the command but the output is going trough Terraform which causes the following error.
UnicodeEncodeError: 'charmap' codec can't encode character '\u2192' in position 3169: character maps to

As you can see, there is a parsing error due to the nature of the output from the dockerfile. Thats why supressing the output of the buildstep is a quick fix for this issue.

Another way to fix this would be to add the encoding="utf-8" in the function that is being used to invoke this command. But that would be on a change on the Terraform side.

Feel free to provide feedback or discuss this further.

resource "null_resource" "create_image" {
for_each = { for k, v in var.container_registries : k => v }
provisioner "local-exec" {
command = "az acr build --no-format --registry ${module.container_registry[each.key].data.name} --image azure-pipelines-agent:1.0 --file Dockerfile.azure-pipelines https://github.com/Azure-Samples/container-apps-ci-cd-runner-tutorial.git"
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant