diff --git a/bitwarden_license/src/Scim/Dockerfile b/bitwarden_license/src/Scim/Dockerfile index ae166cd547..7f7506b339 100644 --- a/bitwarden_license/src/Scim/Dockerfile +++ b/bitwarden_license/src/Scim/Dockerfile @@ -10,13 +10,10 @@ ARG TARGETPLATFORM # We put the value in a file to be read by later layers. RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \ RID=linux-musl-x64 ; \ - #RID=linux-x64 ; \ elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \ RID=linux-musl-arm64 ; \ - #RID=linux-arm64 ; \ elif [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then \ RID=linux-musl-arm ; \ - #RID=linux-arm ; \ fi \ && echo "RID=$RID" > /tmp/rid.txt @@ -50,13 +47,6 @@ ENV SSL_CERT_DIR=/etc/bitwarden/ca-certificates ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false EXPOSE 5000 -# RUN apt-get update \ -# && apt-get install -y --no-install-recommends \ -# gosu \ -# curl \ -# krb5-user \ -# && rm -rf /var/lib/apt/lists/* - RUN apk add curl \ krb5 \ icu-libs \ diff --git a/bitwarden_license/src/Sso/Dockerfile b/bitwarden_license/src/Sso/Dockerfile index 59bc83fc0f..aeb8687d8c 100644 --- a/bitwarden_license/src/Sso/Dockerfile +++ b/bitwarden_license/src/Sso/Dockerfile @@ -10,13 +10,10 @@ ARG TARGETPLATFORM # We put the value in a file to be read by later layers. RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \ RID=linux-musl-x64 ; \ - #RID=linux-x64 ; \ elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \ RID=linux-musl-arm64 ; \ - #RID=linux-arm64 ; \ elif [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then \ RID=linux-musl-arm ; \ - #RID=linux-arm ; \ fi \ && echo "RID=$RID" > /tmp/rid.txt @@ -50,13 +47,6 @@ ENV SSL_CERT_DIR=/etc/bitwarden/ca-certificates ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false EXPOSE 5000 -# RUN apt-get update \ -# && apt-get install -y --no-install-recommends \ -# gosu \ -# curl \ -# krb5-user \ -# && rm -rf /var/lib/apt/lists/* - RUN apk add curl \ krb5 \ icu-libs \ diff --git a/src/Admin/Dockerfile b/src/Admin/Dockerfile index 1e7ac1b489..032ac47560 100644 --- a/src/Admin/Dockerfile +++ b/src/Admin/Dockerfile @@ -20,25 +20,13 @@ ARG TARGETPLATFORM # Determine proper runtime value for .NET RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \ RID=linux-musl-x64 ; \ - #RID=linux-x64 ; \ elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \ RID=linux-musl-arm64 ; \ - #RID=linux-arm64 ; \ elif [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then \ RID=linux-musl-arm ; \ - #RID=linux-arm ; \ fi \ && echo "RID=$RID" > /tmp/rid.txt -# Set up Node -# ARG NODE_VERSION=20 -# RUN apk add --no-cache "nodejs~${NODE_VERSION}" "npm" -# RUN curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION}.x | bash - \ -# && apt-get update \ -# && apt-get install -y nodejs \ -# && npm install -g npm@latest && \ -# rm -rf /var/lib/apt/lists/* - # Copy required project files WORKDIR /source COPY . ./ diff --git a/src/Api/Dockerfile b/src/Api/Dockerfile index 7579a519c7..ba883911eb 100644 --- a/src/Api/Dockerfile +++ b/src/Api/Dockerfile @@ -10,13 +10,10 @@ ARG TARGETPLATFORM # We put the value in a file to be read by later layers. RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \ RID=linux-musl-x64 ; \ - #RID=linux-x64 ; \ elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \ RID=linux-musl-arm64 ; \ - #RID=linux-arm64 ; \ elif [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then \ RID=linux-musl-arm ; \ - #RID=linux-arm ; \ fi \ && echo "RID=$RID" > /tmp/rid.txt @@ -50,13 +47,6 @@ ENV SSL_CERT_DIR=/etc/bitwarden/ca-certificates ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false EXPOSE 5000 -# RUN apt-get update \ -# && apt-get install -y --no-install-recommends \ -# gosu \ -# curl \ -# krb5-user \ -# && rm -rf /var/lib/apt/lists/* - RUN apk add curl \ krb5 \ icu-libs \ diff --git a/src/Billing/Dockerfile b/src/Billing/Dockerfile index 0bdf218338..dfb370a24a 100644 --- a/src/Billing/Dockerfile +++ b/src/Billing/Dockerfile @@ -10,13 +10,10 @@ ARG TARGETPLATFORM # We put the value in a file to be read by later layers. RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \ RID=linux-musl-x64 ; \ - #RID=linux-x64 ; \ elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \ RID=linux-musl-arm64 ; \ - #RID=linux-arm64 ; \ elif [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then \ RID=linux-musl-arm ; \ - #RID=linux-arm ; \ fi \ && echo "RID=$RID" > /tmp/rid.txt diff --git a/src/Events/Dockerfile b/src/Events/Dockerfile index 0ae1b06b19..cb81ab592f 100644 --- a/src/Events/Dockerfile +++ b/src/Events/Dockerfile @@ -10,13 +10,10 @@ ARG TARGETPLATFORM # We put the value in a file to be read by later layers. RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \ RID=linux-musl-x64 ; \ - #RID=linux-x64 ; \ elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \ RID=linux-musl-arm64 ; \ - #RID=linux-arm64 ; \ elif [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then \ RID=linux-musl-arm ; \ - #RID=linux-arm ; \ fi \ && echo "RID=$RID" > /tmp/rid.txt diff --git a/src/EventsProcessor/Dockerfile b/src/EventsProcessor/Dockerfile index ac2032aa39..44537d13a4 100644 --- a/src/EventsProcessor/Dockerfile +++ b/src/EventsProcessor/Dockerfile @@ -10,13 +10,10 @@ ARG TARGETPLATFORM # We put the value in a file to be read by later layers. RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \ RID=linux-musl-x64 ; \ - #RID=linux-x64 ; \ elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \ RID=linux-musl-arm64 ; \ - #RID=linux-arm64 ; \ elif [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then \ RID=linux-musl-arm ; \ - #RID=linux-arm ; \ fi \ && echo "RID=$RID" > /tmp/rid.txt diff --git a/src/Icons/Dockerfile b/src/Icons/Dockerfile index 5015399bb6..3960f65869 100644 --- a/src/Icons/Dockerfile +++ b/src/Icons/Dockerfile @@ -9,13 +9,10 @@ ARG TARGETPLATFORM # Determine proper runtime value for .NET RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \ RID=linux-musl-x64 ; \ - #RID=linux-x64 ; \ elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \ RID=linux-musl-arm64 ; \ - #RID=linux-arm64 ; \ elif [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then \ RID=linux-musl-arm ; \ - #RID=linux-arm ; \ fi \ && echo "RID=$RID" > /tmp/rid.txt diff --git a/src/Identity/Dockerfile b/src/Identity/Dockerfile index d8712f0670..7f3adefb83 100644 --- a/src/Identity/Dockerfile +++ b/src/Identity/Dockerfile @@ -10,13 +10,10 @@ ARG TARGETPLATFORM # We put the value in a file to be read by later layers. RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \ RID=linux-musl-x64 ; \ - #RID=linux-x64 ; \ elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \ RID=linux-musl-arm64 ; \ - #RID=linux-arm64 ; \ elif [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then \ RID=linux-musl-arm ; \ - #RID=linux-arm ; \ fi \ && echo "RID=$RID" > /tmp/rid.txt diff --git a/src/Notifications/Dockerfile b/src/Notifications/Dockerfile index ca6c44fa8f..5d50f9285a 100644 --- a/src/Notifications/Dockerfile +++ b/src/Notifications/Dockerfile @@ -10,13 +10,10 @@ ARG TARGETPLATFORM # We put the value in a file to be read by later layers. RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \ RID=linux-musl-x64 ; \ - #RID=linux-x64 ; \ elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \ RID=linux-musl-arm64 ; \ - #RID=linux-arm64 ; \ elif [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then \ RID=linux-musl-arm ; \ - #RID=linux-arm ; \ fi \ && echo "RID=$RID" > /tmp/rid.txt diff --git a/util/Attachments/Dockerfile b/util/Attachments/Dockerfile index 060740803d..cfa3ae07cd 100644 --- a/util/Attachments/Dockerfile +++ b/util/Attachments/Dockerfile @@ -10,13 +10,10 @@ ARG TARGETPLATFORM # We put the value in a file to be read by later layers. RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \ RID=linux-musl-x64 ; \ - #RID=linux-x64 ; \ elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \ RID=linux-musl-arm64 ; \ - #RID=linux-arm64 ; \ elif [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then \ RID=linux-musl-arm ; \ - #RID=linux-arm ; \ fi \ && echo "RID=$RID" > /tmp/rid.txt @@ -51,12 +48,6 @@ ENV SSL_CERT_DIR=/etc/bitwarden/ca-certificates ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false EXPOSE 5000 -# RUN apt-get update \ -# && apt-get install -y --no-install-recommends \ -# gosu \ -# curl \ -# && rm -rf /var/lib/apt/lists/* - RUN apk add curl \ icu-libs \ && apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community gosu \ diff --git a/util/Nginx/Dockerfile b/util/Nginx/Dockerfile index d0150dd208..a971afa7cb 100644 --- a/util/Nginx/Dockerfile +++ b/util/Nginx/Dockerfile @@ -5,12 +5,6 @@ LABEL com.bitwarden.product="bitwarden" ENV SSL_CERT_DIR=/etc/bitwarden/ca-certificates -# RUN apt-get update \ -# && apt-get install -y --no-install-recommends \ -# gosu \ -# curl \ -# && rm -rf /var/lib/apt/lists/* - RUN apk add curl \ && apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community gosu \ && rm -rf /var/cache/apk/* diff --git a/util/Nginx/Dockerfile-k8s b/util/Nginx/Dockerfile-k8s index 692147a101..cd489c2abc 100644 --- a/util/Nginx/Dockerfile-k8s +++ b/util/Nginx/Dockerfile-k8s @@ -5,12 +5,6 @@ LABEL com.bitwarden.product="bitwarden" ENV USERNAME="bitwarden" ENV GROUPNAME="bitwarden" -# RUN apt-get update && \ -# apt-get install -y --no-install-recommends \ -# gosu \ -# curl && \ -# rm -rf /var/lib/apt/lists/* - RUN apk add curl \ && apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community gosu \ && rm -rf /var/cache/apk/* diff --git a/util/Setup/Dockerfile b/util/Setup/Dockerfile index db886153d3..b486d235e3 100644 --- a/util/Setup/Dockerfile +++ b/util/Setup/Dockerfile @@ -10,13 +10,10 @@ ARG TARGETPLATFORM # We put the value in a file to be read by later layers. RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \ RID=linux-musl-x64 ; \ - #RID=linux-x64 ; \ elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \ RID=linux-musl-arm64 ; \ - #RID=linux-arm64 ; \ elif [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then \ RID=linux-musl-arm ; \ - #RID=linux-arm ; \ fi \ && echo "RID=$RID" > /tmp/rid.txt @@ -45,15 +42,8 @@ FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine ARG TARGETPLATFORM LABEL com.bitwarden.product="bitwarden" com.bitwarden.project="setup" - ENV SSL_CERT_DIR=/etc/bitwarden/ca-certificates -# RUN apt-get update \ -# && apt-get install -y --no-install-recommends \ -# openssl \ -# gosu \ -# && rm -rf /var/lib/apt/lists/* - RUN apk add curl \ openssl \ && apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community gosu \ diff --git a/util/Setup/entrypoint.sh b/util/Setup/entrypoint.sh index b981d760a9..e0395eca84 100644 --- a/util/Setup/entrypoint.sh +++ b/util/Setup/entrypoint.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/sh # Setup @@ -23,11 +23,10 @@ if [ "$(id -u)" = "0" ] then # Create user and group - groupadd -o -g $LGID $GROUPNAME >/dev/null 2>&1 || - groupmod -o -g $LGID $GROUPNAME >/dev/null 2>&1 - useradd -o -u $LUID -g $GROUPNAME -s /bin/false $USERNAME >/dev/null 2>&1 || - usermod -o -u $LUID -g $GROUPNAME -s /bin/false $USERNAME >/dev/null 2>&1 - mkhomedir_helper $USERNAME + addgroup -g "$LGID" -S "$GROUPNAME" 2>/dev/null || true + adduser -u "$LUID" -G "$GROUPNAME" -S -D -H "$USERNAME" 2>/dev/null || true + mkdir -p /home/$USERNAME + chown $USERNAME:$GROUPNAME /home/$USERNAME # The rest...