dotnet / dotnet/dotnet-docker

Clean up Dockerfile formatting

Open
#4,418 1 comment 0 reactions 0 assignees View on GitHub
area-dockerfiles
Dominant language
Dockerfile
Stars
4.9k
Forks
2k
Avg merge
1d 14h
Merged PRs (30d)
26

Description

We should ensure that our Dockerfiles adhere to consistent rules for formatting:

1. There should be 1 newline between instructions, and 2 newlines between stages. Example of where we use two lines between instructions: https://github.com/dotnet/dotnet-docker/blob/c16103459f029ffae2f7f657ec9b002291e25c58/src/runtime-deps/7.0/cbl-mariner2.0-distroless/amd64/Dockerfile#L29-L32
2. Arguments to commands should be in alphabetical order. Example where they aren't: https://github.com/dotnet/dotnet-docker/blob/c16103459f029ffae2f7f657ec9b002291e25c58/src/runtime-deps/7.0/cbl-mariner2.0-distroless/amd64/Dockerfile#L34-L35
3. The alphabetical order for arguments should also extend to things like lists of packages to install: https://github.com/dotnet/dotnet-docker/blob/c16103459f029ffae2f7f657ec9b002291e25c58/src/runtime-deps/7.0/cbl-mariner2.0-distroless/amd64/Dockerfile#L15-L20
(I didn't find a place where we violated this).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.