-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
SUSE Update Bot
committed
Dec 5, 2024
1 parent
e2c2844
commit 6da7f1e
Showing
7 changed files
with
169 additions
and
0 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
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 |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# SPDX-License-Identifier: MIT | ||
|
||
# Copyright (c) 2024 SUSE LLC | ||
|
||
# All modifications and additions to the file contributed by third parties | ||
# remain the property of their copyright owners, unless otherwise agreed | ||
# upon. | ||
|
||
# The content of THIS FILE IS AUTOGENERATED and should not be manually modified. | ||
# It is maintained by the BCI team and generated by | ||
# https://github.com/SUSE/BCI-dockerfile-generator | ||
|
||
# Please submit bugfixes or comments via https://bugs.opensuse.org/ | ||
# You can contact the BCI team via https://github.com/SUSE/bci/discussions | ||
|
||
#!UseOBSRepositories | ||
#!ExclusiveArch: aarch64 x86_64 | ||
#!BuildTag: containers/stunnel:%%stunnel_re%%-%RELEASE% | ||
#!BuildTag: containers/stunnel:%%stunnel_re%% | ||
#!BuildTag: containers/stunnel:5 | ||
#!BuildTag: containers/stunnel:latest | ||
#!ForceMultiVersion | ||
#!BuildName: containers-stunnel-5 | ||
#!BuildVersion: %%stunnel_re%% | ||
#!BuildRelease: 35 | ||
FROM registry.suse.com/bci/bci-micro:15.6 AS target | ||
FROM bci/bci-base:15.6 AS builder | ||
COPY --from=target / /target | ||
|
||
RUN set -euo pipefail; \ | ||
zypper -n --installroot /target --gpg-auto-import-keys install --no-recommends stunnel; \ | ||
zypper -n clean; \ | ||
rm -rf {/target,}/var/log/{alternatives.log,lastlog,tallylog,zypper.log,zypp/history,YaST2} | ||
# sanity check that the version from the tag is equal to the version of stunnel that we expect | ||
RUN set -euo pipefail; \ | ||
[ "$(rpm --root /target -q --qf '%{version}' stunnel | \ | ||
cut -d '.' -f -1)" = "5" ] | ||
FROM registry.suse.com/bci/bci-micro:15.6 | ||
COPY --from=builder /target / | ||
# Define labels according to https://en.opensuse.org/Building_derived_containers | ||
# labelprefix=com.suse.application.stunnel | ||
LABEL org.opencontainers.image.authors="" | ||
LABEL org.opencontainers.image.title="Stunnel" | ||
LABEL org.opencontainers.image.description="Stunnel container based on the SLE Base Container Image." | ||
LABEL org.opencontainers.image.version="%%stunnel_re%%" | ||
LABEL org.opencontainers.image.url="https://apps.rancher.io/applications/stunnel" | ||
LABEL org.opencontainers.image.created="%BUILDTIME%" | ||
LABEL org.opencontainers.image.vendor="SUSE LLC" | ||
LABEL org.opencontainers.image.source="%SOURCEURL%" | ||
LABEL org.opencontainers.image.ref.name="%%stunnel_re%%-%RELEASE%" | ||
LABEL org.opensuse.reference="dp.apps.rancher.io/containers/stunnel:%%stunnel_re%%-%RELEASE%" | ||
LABEL org.openbuildservice.disturl="%DISTURL%" | ||
LABEL com.suse.supportlevel="techpreview" | ||
LABEL com.suse.eula="sle-eula" | ||
LABEL com.suse.lifecycle-url="https://www.suse.com/lifecycle#suse-linux-enterprise-server-15" | ||
LABEL com.suse.release-stage="released" | ||
# endlabelprefix | ||
LABEL org.opencontainers.image.base.name="%BASE_REFNAME%" | ||
LABEL org.opencontainers.image.base.digest="%BASE_DIGEST%" | ||
LABEL io.artifacthub.package.readme-url="%SOURCEURL%/README.md" | ||
COPY entrypoint.sh /usr/local/bin/ | ||
COPY stunnel.conf /etc/stunnel/stunnel.conf | ||
RUN set -euo pipefail; chmod 0755 /usr/local/bin/entrypoint.sh; chown --recursive stunnel /etc/stunnel | ||
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] | ||
CMD ["/usr/sbin/stunnel"] | ||
USER stunnel |
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 |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# Stunnel Container Image | ||
|
||
![Support Level](https://img.shields.io/badge/Support_Level-techpreview-blue)[![SLSA](https://img.shields.io/badge/SLSA_(v1.0)-Build_L3-Green)](https://documentation.suse.com/sbp/server-linux/html/SBP-SLSA4/) | ||
[![Provenance: Available](https://img.shields.io/badge/Provenance-Available-Green)](https://documentation.suse.com/container/all/html/Container-guide/index.html#container-verify) | ||
|
||
|
||
## Description | ||
|
||
Stunnel is an open-source multi-platform application used to provide a universal | ||
TLS/SSL tunneling service. | ||
|
||
|
||
## How to use this Image | ||
|
||
The Stunnel Container Image launches `stunnel` in its entrypoint using the | ||
default configuration shipped with the package. The container must be provided | ||
with a server certificate to establish TLS/SSL connections. It expects the | ||
server key in `/etc/stunnel/stunnel.key` and the certificate in | ||
`/etc/stunnel/stunnel.pem` or in the locations set in the environment variables | ||
`STUNNEL_KEY` and `STUNNEL_CERT`. | ||
|
||
The entrypoint can setup a single service via environment variables so that the | ||
user doesn't have to write and mount their own configuration file. This can be | ||
setup via the environment variables `STUNNEL_SERVICE_NAME`, `STUNNEL_ACCEPT` and | ||
`STUNNEL_CONNECT`: | ||
|
||
- `STUNNEL_SERVICE_NAME`: name or otherwise unique identifier of the service | ||
(used for documentation purpose only) | ||
|
||
- `STUNNEL_ACCEPT`: address on which new connections should be accepted, can be | ||
either a hostname + port number or just a port number (then localhost is | ||
assumed as the host) | ||
|
||
- `STUNNEL_CONNECT`: address on which the un-encrypted service is listening and | ||
to which stunnel connects, can be either a hostname + port number or just a | ||
port number (then localhost is assumed as the host) | ||
|
||
|
||
For example to create an SSL endpoint for a webserver listening on port `8000` | ||
on localhost, execute: | ||
|
||
```bash | ||
podman run --rm -d \ | ||
-p 443:443 \ | ||
-e STUNNEL_SERVICE_NAME=webserver \ | ||
-e STUNNEL_ACCEPT=443 \ | ||
-e STUNNEL_CONNECT=8000 \ | ||
-v=path/to/server.pem:/etc/stunnel/stunnel.pem:Z \ | ||
-v=path/to/server.crt:/etc/stunnel/stunnel.crt:Z \ | ||
dp.apps.rancher.io/containers/stunnel:5 | ||
``` | ||
|
||
## Licensing | ||
|
||
`SPDX-License-Identifier: MIT` | ||
|
||
This documentation and the build recipe are licensed as MIT. | ||
The container itself contains various software components under various open source licenses listed in the associated | ||
Software Bill of Materials (SBOM). | ||
|
||
This image is a tech preview. Do not use it for production. | ||
Your feedback is welcome. | ||
Please report any issues to the [SUSE Bugzilla](https://bugzilla.suse.com/enter_bug.cgi?product=SUSE%20Linux%20Enterprise%20Base%20Container%20Images). |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<services> | ||
<service mode="buildtime" name="docker_label_helper"/> | ||
<service mode="buildtime" name="kiwi_metainfo_helper"/> | ||
<service mode="buildtime" name="replace_using_package_version"> | ||
<param name="file">Dockerfile</param> | ||
<param name="regex">%%stunnel_re%%</param> | ||
<param name="package">stunnel</param> | ||
</service> | ||
</services> |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
STUNNEL_CERT="${STUNNEL_CERT:-/etc/stunnel/stunnel.pem}" | ||
STUNNEL_KEY="${STUNNEL_KEY:-/etc/stunnel/stunnel.key}" | ||
|
||
conf="/etc/stunnel/conf.d/container-ssl.conf" | ||
echo "cert = ${STUNNEL_CERT}" > $conf | ||
echo "key = ${STUNNEL_KEY}" >> $conf | ||
|
||
|
||
if [[ -n "${STUNNEL_SERVICE_NAME}" ]] && [[ -n "${STUNNEL_ACCEPT}" ]] && [[ -n "${STUNNEL_CONNECT}" ]]; then | ||
conf="/etc/stunnel/conf.d/container.conf" | ||
echo "[${STUNNEL_SERVICE_NAME}]" > $conf | ||
echo "accept = ${STUNNEL_ACCEPT}" >> $conf | ||
echo "connect = ${STUNNEL_CONNECT}" >> $conf | ||
fi | ||
|
||
exec "$@" |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
------------------------------------------------------------------- | ||
Thu Dec 05 09:30:22 UTC 2024 - SUSE Update Bot <[email protected]> | ||
|
||
- First version of the Stunnel 5 BCI |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
foreground = yes | ||
include = /etc/stunnel/conf.d |