UTF-16 Dockerfile produces empty output with exit code 0
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 75/100
Research direction
Start at the Dockerfile input and parsing path, then compare how it handles UTF-16 input with the existing empty-file check that reports “file with no instructions.” Reproduce using the provided iconv command and verify the exit status and file contents with --write; done means UTF-16 input returns an error and --write leaves the file untouched.
Written by the indexing model from the issue text.
Description
Given a UTF-16 encoded Dockerfile, dockerfmt prints an empty file and exits 0. With --write it replaces the file with a single newline.
Reproduce
printf 'FROM alpine\nRUN echo hi\n' | iconv -t UTF-16 > Dockerfile
dockerfmt --newline Dockerfile | od -c
Actual
0000000 \n
Exit code 0. dockerfmt --write --newline Dockerfile turns the 50-byte file into one newline.
Expected
A non-zero exit with an error, the way an empty file gets file with no instructions, and the file left untouched.
Windows PowerShell's > redirection writes UTF-16 by default, so these files exist in practice.
Reproduced with v0.5.4 and with main at a5868c2.
- Dominant language
- Go
- Stars
- 626
- Forks
- 23
- Avg merge
- 6d 23h
- Merged PRs (30d)
- 3
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from reteps/dockerfmt
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
`MAINTAINER` to `LABEL` conversion does not escape embedded quotesPossibly taken @RyoKusnadi claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Legacy `ENV key value` with a multi-word value becomes an invalid `key=value`Possibly taken @RyoKusnadi claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
All issues in reteps/dockerfmt
Similar issues
-
Cluster details: the Control Plane version field has a different border color than its icon boxOpenkind/design sig/ui
Difficulty 1/5 Under an hour Newbie friendliness 92/100
kubermatic/dashboard#8449 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
filecoin-project/curio#1632 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
-
compose: derived node options overwrite each other's targetsPossibly taken @yangjj-iso claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day