-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
46 lines (38 loc) · 1.75 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
FROM alpine:3.21
RUN apk -u --no-cache add doas yamllint
ARG USERNAME=yamllint
RUN addgroup -S $USERNAME && adduser -D -S $USERNAME -G $USERNAME && \
echo "permit nopass keepenv $USERNAME as root" > /etc/doas.d/doas.conf && \
mkdir -p /test && \
chown -R $USERNAME:$USERNAME /test && \
echo "---" >> /test/test.yaml && \
echo "key: value" >> /test/test.yaml
HEALTHCHECK --interval=5m --timeout=3s --retries=3 CMD yamllint /test/test.yaml || exit 1
WORKDIR /$USERNAME
USER $USERNAME
ENTRYPOINT ["yamllint"]
## LABELS
ARG VCS_REF
ARG BUILD_VERSION
ARG BUILD_DATE
ARG IMAGE_TAG=ghcr.io/devgine/yamllint:latest
LABEL maintainer="[email protected]"
LABEL org.opencontainers.image.title="Yaml lint docker image"
LABEL org.opencontainers.image.description="A docker image that validate yaml files."
LABEL org.opencontainers.image.source="https://github.com/devgine/yamllint"
LABEL org.opencontainers.image.licenses=MIT
LABEL org.opencontainers.image.created=$BUILD_DATE
LABEL org.opencontainers.image.url="https://github.com/devgine/yamllint"
LABEL org.opencontainers.image.version=$BUILD_VERSION
LABEL org.opencontainers.image.revision=$VCS_REF
LABEL org.opencontainers.image.vendor="devgine"
LABEL org.label-schema.schema-version="1.0"
LABEL org.label-schema.build-date=$BUILD_DATE
LABEL org.label-schema.name="devgine/yamllint"
LABEL org.label-schema.description="A docker image that validate yaml files."
LABEL org.label-schema.url="https://github.com/devgine/yamllint"
LABEL org.label-schema.vcs-url="https://github.com/devgine/yamllint"
LABEL org.label-schema.vcs-ref=$VCS_REF
LABEL org.label-schema.version=$BUILD_VERSION
LABEL org.label-schema.docker.cmd="docker run --rm -v local-dir:/srv $IMAGE_TAG /srv -s -f colored"
LABEL org.label-schema.vendor="devgine"