12 Commits

Author SHA1 Message Date
Olliver Schinagl
00beb9595d
container: Cleanup some style issues
Commit 5635dc5142aa ("Enable --transparent mode for docker") made a
little bit of a mess of the Dockerfile and container-entrypoint.sh.

A few issues are, but not limited to; trailing whitespaces, incorrect
indentation, removed final newline, component sortability just to name a
few.

This MR fixes that and cleans up those files again.

One thing not touched was the enable/disablement of `set +e` to exit the
script on error. It is nicer/cleaner to solve this in a different way,
but that adds to much complexity.

While here, make the container architecture and alpine version
configurable, allowing us to build multi-arch images from the CI in the
future.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
2023-08-08 09:01:51 +02:00
clement
8ff27e931f Change ordering for better layer caching 2023-07-22 06:46:00 +08:00
clement
5635dc5142 Enable --transparent mode for docker 2023-07-21 06:58:18 +08:00
Olliver Schinagl
9dd560493a
container: Drop privileges
A container is best served with the least amount of privileges. This
also ensures we don't have to drop anything later.

This does require running the container with elevated capabilities.

Note, that if for whatever reason, 'root' access within the container is
needed, this can easily be accomplished by running the container with
`docker run --user root:root sslh` for example.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
2023-06-05 22:50:06 +02:00
Olliver Schinagl
db5ed29fa2
docker: Add proper entrypoint
As per docker guidelines [0] a container should always really have a
consistent entrypoint, without having to override it or do special
tricks.

The behavior should be _identical_ as before, but will no longer trigger
errors because sslh doesn't understand certain parameters (/bin/sh
for example being common). Further more, allows a proper entrypoint for
a CI to work easily with the container as well. Allowing for scenario's
such as `apk add git && sslh --foreground` in your sslh image for example.

E.g. `docker run sslh --help` works though with the default
`--foreground` a bit weirdly, as does `docker run sslh
/bin/sh` or `docker run sslh ls`.

[0]: https://github.com/docker-library/official-images#consistency

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
2023-06-05 22:50:06 +02:00
Olliver Schinagl
295dba93b5
docker: Do not foreground by default, this should be a choice
It is weird that when invoking sslh, that it daemonizess in foreground by
default. This should always be a user choice, and if not, it should be a
program default.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
2023-06-05 22:50:06 +02:00
Olliver Schinagl
20764074cb
docker: Improve caching layers
Docker is most efficient if you can 'order' the layers from
least-changing to most changing to improve on cache hits.

While here, change ADD to COPY as add is really intended to download
external packages, as well as installing sslh into a proper location.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
2023-06-05 22:05:24 +02:00
Jerome
32b065d895 fixed docker compilation error 2022-04-09 22:09:40 +02:00
yrutschle
1e0578c082 don't log to syslog when testing 2022-03-18 18:02:32 +01:00
Belisarith
18eeaa579a additional fix dockerfile, otherwise docker is not runnable 2021-11-23 12:57:16 +00:00
Belisarith
80f2d758a4 Correct wrong version of pcre in Dockerfile 2021-11-23 12:40:17 +00:00
Taras Inzyk
95a6577cda add Dockerfile 2019-04-06 17:26:08 +05:00