-
Notifications
You must be signed in to change notification settings - Fork 367
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #393 from oliv3r/dev/cleanup
container: Cleanup some style issues
- Loading branch information
Showing
2 changed files
with
69 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,38 @@ | ||
FROM alpine:latest as build | ||
ARG ALPINE_VERSION="latest" | ||
ARG TARGET_ARCH="library" | ||
|
||
FROM docker.io/${TARGET_ARCH}/alpine:${ALPINE_VERSION} AS build | ||
|
||
WORKDIR /sslh | ||
|
||
RUN apk add gcc libconfig-dev make musl-dev pcre2-dev perl | ||
RUN apk add --no-cache \ | ||
'gcc' \ | ||
'libconfig-dev' \ | ||
'make' \ | ||
'musl-dev' \ | ||
'pcre2-dev' \ | ||
'perl' \ | ||
; | ||
|
||
COPY . /sslh | ||
RUN make sslh-select && strip sslh-select | ||
|
||
FROM alpine:latest | ||
|
||
RUN apk --no-cache add libconfig pcre2 iptables ip6tables libcap | ||
RUN make sslh-select && strip sslh-select | ||
|
||
RUN adduser sslh --shell /bin/sh --disabled-password | ||
FROM docker.io/${TARGET_ARCH}/alpine:${ALPINE_VERSION} | ||
|
||
COPY --from=build "/sslh/sslh-select" "/usr/local/bin/sslh" | ||
RUN setcap cap_net_bind_service,cap_net_raw+ep /usr/local/bin/sslh | ||
RUN apk add --no-cache \ | ||
'libconfig' \ | ||
'pcre2' \ | ||
'iptables' \ | ||
'ip6tables' \ | ||
'libcap' \ | ||
&& \ | ||
adduser -s '/bin/sh' -S -D sslh && \ | ||
setcap cap_net_bind_service,cap_net_raw+ep /usr/local/bin/sslh | ||
|
||
COPY "./container-entrypoint.sh" "/init" | ||
ENTRYPOINT [ "/init" ] | ||
|
||
# required for updating iptables | ||
USER root:root | ||
USER root:root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters