A Node.js Docker image with Prettier:
git and Task,1000) with support of arbitrary UIDs (OpenShift, docker run --user),multiarch with support of amd64 and arm64,Renovate tracks the Prettier, Task and base image versions and opens the merge requests,SBOM) attestation added using Syft,The working directory of the image is /work. There is no prettier entrypoint (the entrypoint only passes the command through): the command is explicit.
Check the formatting (read-only):
docker run --rm -v $(pwd):/work jfxs/prettier prettier --check .
--write)The container does not run as root (uid 1000), so it can only modify files it is allowed to write. To rewrite files with --write, run the container with your own uid and gid, so that the files keep your ownership:
docker run --rm --user "$(id -u):$(id -g)" -v $(pwd):/work jfxs/prettier prettier --write .
--user "$(id -u):$(id -g)" is needed unless your uid is 1000; otherwise prettier fails with EACCES: permission denied.--user 0:0 (or --userns=keep-id with Podman) to be mapped to your own user.--user root just to write files: they would then belong to root on your host.prettier-check:
image: jfxs/prettier:latest
stage: lint
script:
- prettier --check .
The image has no prettier entrypoint, so the job needs no entrypoint: [""] override. The job runs as uid 1000:
use --check in CI (read-only); to commit reformatted files, run --write locally as described above.
tmknom/prettiertmknom/prettier used prettier as entrypoint and /work as working directory. With this image the working
directory is the same, but the command must be explicit:
# before
docker run --rm -v $(pwd):/work tmknom/prettier --check .
# after
docker run --rm -v $(pwd):/work jfxs/prettier prettier --check .
Like tmknom/prettier, the container runs as a non-root user: see Writing files for --write.
Docker latest tag is 3.9.9-001, 3.9, 3.
The complete software bill of materials (SBOM) of each published image, with its known vulnerabilities,
is collected in the sbom-docker repository, under the
component prettier.
Dockerhub Overview page has the details of the last published image.
Docker tag definition:
<prettier_version>-<increment>
Example: 3.9.9-001
Cosign public key:
-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEa3yV6+yd/l4zh/tfT6Tx+zn0dhy3
BhFqSad1norLeKSCN2MILv4fZ9GA6ODOlJOw+7vzUvzZVr9IXnxEdjoWJw==
-----END PUBLIC KEY-----
The public key is also available online: https://gitlab.com/op_so/docker/cosign-public-key/-/raw/main/cosign.pub.
To verify an image:
cosign verify --key cosign.pub $IMAGE_URI
To verify and get the software bill of materials (SBOM) attestation:
cosign verify-attestation --key cosign.pub --type spdxjson $IMAGE_URI | jq '.payload | @base64d | fromjson | .predicate'
This program is free software: you can redistribute it and/or modify it under the terms of the MIT License (MIT). See the LICENSE for details.
Content type
Image
Digest
sha256:a3823db65…
Size
135 MB
Last updated
4 days ago
docker pull jfxs/prettier