From c36d4bcad128d5f5f3d9f4501a4ff1cc25e201ef Mon Sep 17 00:00:00 2001 From: Johann Hoffmann Date: Wed, 17 Aug 2022 18:07:24 +0200 Subject: [PATCH] Switch to Debian-slim base images Signed-off-by: Johann Hoffmann --- Dockerfile | 22 +++++++++++----------- docker-entrypoint.sh | 4 ++-- wait-for-postgres.sh | 4 ++-- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Dockerfile b/Dockerfile index 76a96ce9..99d56a55 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,16 @@ -ARG ALPINE_VERSION=3.16.2 +ARG DEBIAN_VERSION=11.4-slim ARG POCO_VERSION=poco-tip-v1 ARG FMTLIB_VERSION=9.0.0 ARG CPPKAFKA_VERSION=tip-v1 ARG JSON_VALIDATOR_VERSION=2.1.0 -FROM alpine:$ALPINE_VERSION AS build-base +FROM debian:$DEBIAN_VERSION AS build-base -RUN apk add --update --no-cache \ +RUN apt-get update && apt-get install --no-install-recommends -y \ make cmake g++ git \ - unixodbc-dev postgresql-dev mariadb-dev \ - librdkafka-dev boost-dev openssl-dev \ - zlib-dev nlohmann-json + unixodbc-dev libpq-dev libmariadb-dev libmariadbclient-dev-compat \ + librdkafka-dev libboost-all-dev libssl-dev \ + zlib1g-dev nlohmann-json3-dev FROM build-base AS poco-build @@ -90,21 +90,21 @@ WORKDIR /owgw/cmake-build RUN cmake .. RUN cmake --build . --config Release -j8 -FROM alpine:$ALPINE_VERSION +FROM debian:$DEBIAN_VERSION ENV OWGW_USER=owgw \ OWGW_ROOT=/owgw-data \ OWGW_CONFIG=/owgw-data -RUN addgroup -S "$OWGW_USER" && \ - adduser -S -G "$OWGW_USER" "$OWGW_USER" +RUN useradd "$OWGW_USER" RUN mkdir /openwifi RUN mkdir -p "$OWGW_ROOT" "$OWGW_CONFIG" && \ chown "$OWGW_USER": "$OWGW_ROOT" "$OWGW_CONFIG" -RUN apk add --update --no-cache librdkafka su-exec gettext ca-certificates bash jq curl \ - mariadb-connector-c libpq unixodbc postgresql-client +RUN apt-get update && apt-get install --no-install-recommends -y \ + librdkafka++1 gosu gettext ca-certificates bash jq curl wget \ + libmariadb-dev-compat libpq5 unixodbc COPY readiness_check /readiness_check COPY test_scripts/curl/cli /cli diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index f3254b3d..2360b9c9 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash set -e if [ "$SELFSIGNED_CERTS" = 'true' ]; then @@ -86,7 +86,7 @@ if [ "$1" = '/openwifi/owgw' -a "$(id -u)" = '0' ]; then if [ "$RUN_CHOWN" = 'true' ]; then chown -R "$OWGW_USER": "$OWGW_ROOT" "$OWGW_CONFIG" fi - exec su-exec "$OWGW_USER" "$@" + exec gosu "$OWGW_USER" "$@" fi exec "$@" diff --git a/wait-for-postgres.sh b/wait-for-postgres.sh index 1b1b2187..6cf5a7a7 100755 --- a/wait-for-postgres.sh +++ b/wait-for-postgres.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # wait-for-postgres.sh set -e @@ -20,7 +20,7 @@ if [ "$1" = '/openwifi/owgw' -a "$(id -u)" = '0' ]; then if [ "$RUN_CHOWN" = 'true' ]; then chown -R "$OWGW_USER": "$OWGW_ROOT" "$OWGW_CONFIG" fi - exec su-exec "$OWGW_USER" "$@" + exec gosu "$OWGW_USER" "$@" fi exec "$@"