From e6e0ac315bda5dccb98f10e59c1dabaa6addabed Mon Sep 17 00:00:00 2001 From: Bitnami Bot Date: Tue, 26 Jun 2018 09:48:33 +0000 Subject: [PATCH] 3.3.8-ol-7-r0 release Initial release version 3.3.8 --- bitnami/etcd/3/ol-7/Dockerfile | 30 ++++++++++++++++++ bitnami/etcd/3/ol-7/docker-compose.yml | 12 +++++++ bitnami/etcd/3/ol-7/rootfs/entrypoint.sh | 40 ++++++++++++++++++++++++ bitnami/etcd/README.md | 2 +- 4 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 bitnami/etcd/3/ol-7/Dockerfile create mode 100644 bitnami/etcd/3/ol-7/docker-compose.yml create mode 100755 bitnami/etcd/3/ol-7/rootfs/entrypoint.sh diff --git a/bitnami/etcd/3/ol-7/Dockerfile b/bitnami/etcd/3/ol-7/Dockerfile new file mode 100644 index 000000000000..15314673d9ff --- /dev/null +++ b/bitnami/etcd/3/ol-7/Dockerfile @@ -0,0 +1,30 @@ +FROM bitnami/oraclelinux-extras:7-r18 as buildenv + +RUN install_packages ca-certificates wget +RUN wget -nc -P /tmp/bitnami/pkg/cache/ https://downloads.bitnami.com/files/stacksmith/etcd-3.3.8-0-linux-x86_64-ol-7.tar.gz && \ + echo "0d4e165486b30b19068681b84c320f492ac987a27294bd9615c827d2e550377b /tmp/bitnami/pkg/cache/etcd-3.3.8-0-linux-x86_64-ol-7.tar.gz" | sha256sum -c - && \ + tar -zxf /tmp/bitnami/pkg/cache/etcd-3.3.8-0-linux-x86_64-ol-7.tar.gz -P --transform 's|^[^/]*/files|/opt/bitnami|' --wildcards '*/files' && \ + rm -rf /tmp/bitnami/pkg/cache/etcd-3.3.8-0-linux-x86_64-ol-7.tar.gz + +################## + +FROM bitnami/oraclelinux-extras:7-r18 +LABEL maintainer "Bitnami " + +COPY --from=buildenv /opt/bitnami/etcd /opt/bitnami/etcd +ENV BITNAMI_APP_NAME="etcd" \ + BITNAMI_IMAGE_VERSION="3.3.8-ol-7-r0" \ + ETCD_ADVERTISE_CLIENT_URLS="http://127.0.0.1:2379" \ + ETCD_DATA_DIR="/opt/bitnami/etcd/data/" \ + ETCD_LISTEN_CLIENT_URLS="http://0.0.0.0:2379" \ + PATH="/opt/bitnami/etcd/bin:$PATH" + +RUN chmod g+rwX /opt/bitnami/etcd + +EXPOSE 2379 2380 + +COPY rootfs / +WORKDIR /opt/bitnami/etcd +USER 1001 +ENTRYPOINT ["/entrypoint.sh"] +CMD ["etcd"] diff --git a/bitnami/etcd/3/ol-7/docker-compose.yml b/bitnami/etcd/3/ol-7/docker-compose.yml new file mode 100644 index 000000000000..116f73d4d6b3 --- /dev/null +++ b/bitnami/etcd/3/ol-7/docker-compose.yml @@ -0,0 +1,12 @@ +version: '2' + +services: + etcd: + image: bitnami/etcd:3-ol-7 + environment: + - ALLOW_NONE_AUTHENTICATION=yes + volumes: + - etcd_data:/bitnami +volumes: + etcd_data: + driver: local diff --git a/bitnami/etcd/3/ol-7/rootfs/entrypoint.sh b/bitnami/etcd/3/ol-7/rootfs/entrypoint.sh new file mode 100755 index 000000000000..be5a2a34da37 --- /dev/null +++ b/bitnami/etcd/3/ol-7/rootfs/entrypoint.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +## +## @brief Helper function to show an error when ETCD_ROOT_PASSWORD does not enable the authentication +## param $1 Input name +## +authentication_enabled_error() { + echo "The $1 environment variable does not enable authentication. Set the environment variable ALLOW_NONE_AUTHENTICAION=yes to allow the container to be started without authentication. This is recommended only for development." + exit 1 +} + +## +## @brief Helper function to show a warning when the ALLOW_NONE_AUTHENTICATION flag is enabled +## +authentication_enabled_warn() { + echo "You set the environment variable ALLOW_NONE_AUTHENTICATION=${ALLOW_NONE_AUTHENTICATION}. For safety reasons, do not use this flag in a production environment." +} + + +# Validate authentication +if [[ "$ALLOW_NONE_AUTHENTICATION" =~ ^(yes|Yes|YES)$ ]]; then + authentication_enabled_warn +elif [[ -z "$ETCD_ROOT_PASSWORD" ]]; then + authentication_enabled_error ETCD_ROOT_PASSWORD +fi + +# Validate authentication +if [[ ! -z "$ETCD_ROOT_PASSWORD" ]]; then + echo "==> Enabling etcd authentication..." + etcd > /dev/null 2>&1 & + ETCD_PID=$! + sleep 3 + echo "$ETCD_ROOT_PASSWORD" | etcdctl user add root + etcdctl auth enable + etcdctl -u root:"$ETCD_ROOT_PASSWORD" role revoke guest -path '/*' --readwrite + kill $ETCD_PID +fi + + +exec "$@" diff --git a/bitnami/etcd/README.md b/bitnami/etcd/README.md index 915bc3003ccc..739459978ad1 100644 --- a/bitnami/etcd/README.md +++ b/bitnami/etcd/README.md @@ -30,7 +30,7 @@ $ docker-compose up # Supported tags and respective `Dockerfile` links * [`3`, `3.3.8-r1`, `latest` (3/Dockerfile)](https://github.com/bitnami/bitnami-docker-etcd/blob/3.3.8-r1/3/Dockerfile) -* [`3-ol-7`, `0.0.0-ol-7-r0` (3/ol-7/Dockerfile)](https://github.com/bitnami/bitnami-docker-etcd/blob/0.0.0-ol-7-r0/3/ol-7/Dockerfile) +* [`3-ol-7`, `3.3.8-ol-7-r0` (3/ol-7/Dockerfile)](https://github.com/bitnami/bitnami-docker-etcd/blob/3.3.8-ol-7-r0/3/ol-7/Dockerfile) Subscribe to project updates by watching the [bitnami/etcd GitHub repo](https://github.com/bitnami/bitnami-docker-etcd).