ntfy : hadolint Containerfile
This commit is contained in:
parent
c5c66efbd7
commit
7e7d340ab8
|
@ -3,34 +3,26 @@ FROM docker.io/library/golang:1.20-alpine3.17 AS build-env
|
||||||
|
|
||||||
ARG NTFY_VERSION
|
ARG NTFY_VERSION
|
||||||
|
|
||||||
#Build deps
|
RUN apk --no-cache add build-base git nodejs npm upx py3-pip \
|
||||||
RUN apk --no-cache add build-base git nodejs npm upx py3-pip
|
&& go install github.com/goreleaser/goreleaser@latest \
|
||||||
|
&& git clone --depth=1 -b "${NTFY_VERSION}" https://github.com/binwiederhier/ntfy.git /ntfybuild
|
||||||
#Install gorealeaser
|
WORKDIR /ntfybuild
|
||||||
RUN go install github.com/goreleaser/goreleaser@latest
|
RUN make web && make docs && make cli-linux-amd64
|
||||||
|
|
||||||
#Setup repo
|
|
||||||
RUN git clone --depth=1 -b "${NTFY_VERSION}" https://github.com/binwiederhier/ntfy.git
|
|
||||||
|
|
||||||
#Build
|
|
||||||
RUN cd ntfy && make web && make docs && make cli-linux-amd64
|
|
||||||
|
|
||||||
FROM docker.io/library/alpine:3.17
|
FROM docker.io/library/alpine:3.17
|
||||||
LABEL maintainer="contact@garbaye.fr"
|
LABEL maintainer="contact@garbaye.fr"
|
||||||
|
|
||||||
EXPOSE 80/tcp
|
EXPOSE 80/tcp
|
||||||
|
|
||||||
RUN apk add --no-cache tzdata && \
|
RUN apk add --no-cache tzdata \
|
||||||
adduser \
|
&& adduser -S -H -D ntfy \
|
||||||
-S -H -D \
|
&& mkdir /etc/ntfy \
|
||||||
ntfy && \
|
&& chown ntfy:nogroup /etc/ntfy \
|
||||||
mkdir /etc/ntfy && \
|
&& mkdir /var/cache/ntfy \
|
||||||
chown ntfy:nogroup /etc/ntfy && \
|
&& chown ntfy:nogroup /var/cache/ntfy
|
||||||
mkdir /var/cache/ntfy && \
|
|
||||||
chown ntfy:nogroup /var/cache/ntfy
|
|
||||||
|
|
||||||
USER ntfy
|
USER ntfy
|
||||||
|
|
||||||
ENTRYPOINT ["ntfy"]
|
ENTRYPOINT ["ntfy"]
|
||||||
|
|
||||||
COPY --from=build-env /go/ntfy/dist/ntfy_linux_amd64_linux_amd64_v1/ntfy /usr/bin/ntfy
|
COPY --from=build-env /ntfybuild/dist/ntfy_linux_amd64_linux_amd64_v1/ntfy /usr/bin/ntfy
|
||||||
|
|
Loading…
Reference in a new issue