1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-18 01:53:49 -05:00

testing alpine

This commit is contained in:
AJ Mabry 2025-06-17 09:47:24 -04:00
parent c1c75d3946
commit 3391ede525
No known key found for this signature in database
GPG Key ID: 959B72506842FAE9
14 changed files with 163 additions and 89 deletions

View File

@ -1,7 +1,7 @@
############################################### ###############################################
# Build stage # # Build stage #
############################################### ###############################################
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build
# Docker buildx supplies the value for this arg # Docker buildx supplies the value for this arg
ARG TARGETPLATFORM ARG TARGETPLATFORM
@ -9,11 +9,14 @@ ARG TARGETPLATFORM
# Determine proper runtime value for .NET # Determine proper runtime value for .NET
# We put the value in a file to be read by later layers. # We put the value in a file to be read by later layers.
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \ RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
RID=linux-x64 ; \ RID=linux-musl-x64 ; \
#RID=linux-x64 ; \
elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \ elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
RID=linux-arm64 ; \ RID=linux-musl-arm64 ; \
#RID=linux-arm64 ; \
elif [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then \ elif [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then \
RID=linux-arm ; \ RID=linux-musl-arm ; \
#RID=linux-arm ; \
fi \ fi \
&& echo "RID=$RID" > /tmp/rid.txt && echo "RID=$RID" > /tmp/rid.txt
@ -37,21 +40,28 @@ RUN . /tmp/rid.txt && dotnet publish \
############################################### ###############################################
# App stage # # App stage #
############################################### ###############################################
FROM mcr.microsoft.com/dotnet/aspnet:8.0 FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine
ARG TARGETPLATFORM ARG TARGETPLATFORM
LABEL com.bitwarden.product="bitwarden" LABEL com.bitwarden.product="bitwarden"
ENV ASPNETCORE_ENVIRONMENT=Production ENV ASPNETCORE_ENVIRONMENT=Production
ENV ASPNETCORE_URLS=http://+:5000 ENV ASPNETCORE_URLS=http://+:5000
ENV SSL_CERT_DIR=/etc/bitwarden/ca-certificates ENV SSL_CERT_DIR=/etc/bitwarden/ca-certificates
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
EXPOSE 5000 EXPOSE 5000
RUN apt-get update \ # RUN apt-get update \
&& apt-get install -y --no-install-recommends \ # && apt-get install -y --no-install-recommends \
gosu \ # gosu \
curl \ # curl \
krb5-user \ # krb5-user \
&& rm -rf /var/lib/apt/lists/* # && rm -rf /var/lib/apt/lists/*
RUN apk add curl \
krb5 \
icu-libs \
&& apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community gosu \
&& rm -rf /var/cache/apk/*
# Copy app from the build stage # Copy app from the build stage
WORKDIR /app WORKDIR /app

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/bin/sh
# Setup # Setup

View File

@ -1,7 +1,7 @@
############################################### ###############################################
# Build stage # # Build stage #
############################################### ###############################################
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build
# Docker buildx supplies the value for this arg # Docker buildx supplies the value for this arg
ARG TARGETPLATFORM ARG TARGETPLATFORM
@ -9,11 +9,14 @@ ARG TARGETPLATFORM
# Determine proper runtime value for .NET # Determine proper runtime value for .NET
# We put the value in a file to be read by later layers. # We put the value in a file to be read by later layers.
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \ RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
RID=linux-x64 ; \ RID=linux-musl-x64 ; \
#RID=linux-x64 ; \
elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \ elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
RID=linux-arm64 ; \ RID=linux-musl-arm64 ; \
#RID=linux-arm64 ; \
elif [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then \ elif [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then \
RID=linux-arm ; \ RID=linux-musl-arm ; \
#RID=linux-arm ; \
fi \ fi \
&& echo "RID=$RID" > /tmp/rid.txt && echo "RID=$RID" > /tmp/rid.txt
@ -37,21 +40,28 @@ RUN . /tmp/rid.txt && dotnet publish \
############################################### ###############################################
# App stage # # App stage #
############################################### ###############################################
FROM mcr.microsoft.com/dotnet/aspnet:8.0 FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine
ARG TARGETPLATFORM ARG TARGETPLATFORM
LABEL com.bitwarden.product="bitwarden" LABEL com.bitwarden.product="bitwarden"
ENV ASPNETCORE_ENVIRONMENT=Production ENV ASPNETCORE_ENVIRONMENT=Production
ENV ASPNETCORE_URLS=http://+:5000 ENV ASPNETCORE_URLS=http://+:5000
ENV SSL_CERT_DIR=/etc/bitwarden/ca-certificates ENV SSL_CERT_DIR=/etc/bitwarden/ca-certificates
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
EXPOSE 5000 EXPOSE 5000
RUN apt-get update \ # RUN apt-get update \
&& apt-get install -y --no-install-recommends \ # && apt-get install -y --no-install-recommends \
gosu \ # gosu \
curl \ # curl \
krb5-user \ # krb5-user \
&& rm -rf /var/lib/apt/lists/* # && rm -rf /var/lib/apt/lists/*
RUN apk add curl \
krb5 \
icu-libs \
&& apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community gosu \
&& rm -rf /var/cache/apk/*
# Copy app from the build stage # Copy app from the build stage
WORKDIR /app WORKDIR /app

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/bin/sh
# Setup # Setup

View File

@ -1,18 +1,21 @@
############################################### ###############################################
# Build stage # # Build stage #
############################################### ###############################################
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build
# Docker buildx supplies the value for this arg # Docker buildx supplies the value for this arg
ARG TARGETPLATFORM ARG TARGETPLATFORM
# Determine proper runtime value for .NET # Determine proper runtime value for .NET
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \ RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
RID=linux-x64 ; \ RID=linux-musl-x64 ; \
#RID=linux-x64 ; \
elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \ elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
RID=linux-arm64 ; \ RID=linux-musl-arm64 ; \
#RID=linux-arm64 ; \
elif [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then \ elif [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then \
RID=linux-arm ; \ RID=linux-musl-arm ; \
#RID=linux-arm ; \
fi \ fi \
&& echo "RID=$RID" > /tmp/rid.txt && echo "RID=$RID" > /tmp/rid.txt
@ -46,13 +49,14 @@ RUN . /tmp/rid.txt && dotnet publish \
############################################### ###############################################
# App stage # # App stage #
############################################### ###############################################
FROM cgr.dev/chainguard/wolfi-base:latest FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine
ARG TARGETPLATFORM ARG TARGETPLATFORM
LABEL com.bitwarden.product="bitwarden" LABEL com.bitwarden.product="bitwarden"
ENV ASPNETCORE_ENVIRONMENT=Production ENV ASPNETCORE_ENVIRONMENT=Production
ENV ASPNETCORE_URLS=http://+:5000 ENV ASPNETCORE_URLS=http://+:5000
ENV SSL_CERT_DIR=/etc/bitwarden/ca-certificates ENV SSL_CERT_DIR=/etc/bitwarden/ca-certificates
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
EXPOSE 5000 EXPOSE 5000
RUN apk add gosu \ RUN apk add gosu \

View File

@ -1,7 +1,7 @@
############################################### ###############################################
# Build stage # # Build stage #
############################################### ###############################################
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build
# Docker buildx supplies the value for this arg # Docker buildx supplies the value for this arg
ARG TARGETPLATFORM ARG TARGETPLATFORM
@ -9,11 +9,14 @@ ARG TARGETPLATFORM
# Determine proper runtime value for .NET # Determine proper runtime value for .NET
# We put the value in a file to be read by later layers. # We put the value in a file to be read by later layers.
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \ RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
RID=linux-x64 ; \ RID=linux-musl-x64 ; \
#RID=linux-x64 ; \
elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \ elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
RID=linux-arm64 ; \ RID=linux-musl-arm64 ; \
#RID=linux-arm64 ; \
elif [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then \ elif [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then \
RID=linux-arm ; \ RID=linux-musl-arm ; \
#RID=linux-arm ; \
fi \ fi \
&& echo "RID=$RID" > /tmp/rid.txt && echo "RID=$RID" > /tmp/rid.txt
@ -37,21 +40,27 @@ RUN . /tmp/rid.txt && dotnet publish \
############################################### ###############################################
# App stage # # App stage #
############################################### ###############################################
FROM cgr.dev/chainguard/wolfi-base:latest FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/aspnet:8.0-alpine
ARG TARGETPLATFORM ARG TARGETPLATFORM
LABEL com.bitwarden.product="bitwarden" LABEL com.bitwarden.product="bitwarden"
ENV ASPNETCORE_ENVIRONMENT=Production ENV ASPNETCORE_ENVIRONMENT=Production
ENV ASPNETCORE_URLS=http://+:5000 ENV ASPNETCORE_URLS=http://+:5000
ENV SSL_CERT_DIR=/etc/bitwarden/ca-certificates ENV SSL_CERT_DIR=/etc/bitwarden/ca-certificates
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
EXPOSE 5000 EXPOSE 5000
RUN apk add gosu \ # RUN apt-get update \
curl \ # && apt-get install -y --no-install-recommends \
# gosu \
# curl \
# krb5-user \
# && rm -rf /var/lib/apt/lists/*
RUN apk add curl \
krb5 \ krb5 \
icu \ icu-libs \
tzdata \ && apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community gosu \
libstdc++ \
&& rm -rf /var/cache/apk/* && rm -rf /var/cache/apk/*
# Copy app from the build stage # Copy app from the build stage

View File

@ -1,7 +1,7 @@
############################################### ###############################################
# Build stage # # Build stage #
############################################### ###############################################
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build
# Docker buildx supplies the value for this arg # Docker buildx supplies the value for this arg
ARG TARGETPLATFORM ARG TARGETPLATFORM
@ -9,11 +9,14 @@ ARG TARGETPLATFORM
# Determine proper runtime value for .NET # Determine proper runtime value for .NET
# We put the value in a file to be read by later layers. # We put the value in a file to be read by later layers.
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \ RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
RID=linux-x64 ; \ RID=linux-musl-x64 ; \
#RID=linux-x64 ; \
elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \ elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
RID=linux-arm64 ; \ RID=linux-musl-arm64 ; \
#RID=linux-arm64 ; \
elif [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then \ elif [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then \
RID=linux-arm ; \ RID=linux-musl-arm ; \
#RID=linux-arm ; \
fi \ fi \
&& echo "RID=$RID" > /tmp/rid.txt && echo "RID=$RID" > /tmp/rid.txt
@ -37,13 +40,14 @@ RUN . /tmp/rid.txt && dotnet publish \
############################################### ###############################################
# App stage # # App stage #
############################################### ###############################################
FROM cgr.dev/chainguard/wolfi-base:latest FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/aspnet:8.0-alpine
ARG TARGETPLATFORM ARG TARGETPLATFORM
LABEL com.bitwarden.product="bitwarden" LABEL com.bitwarden.product="bitwarden"
ENV ASPNETCORE_ENVIRONMENT=Production ENV ASPNETCORE_ENVIRONMENT=Production
ENV ASPNETCORE_URLS=http://+:5000 ENV ASPNETCORE_URLS=http://+:5000
ENV SSL_CERT_DIR=/etc/bitwarden/ca-certificates ENV SSL_CERT_DIR=/etc/bitwarden/ca-certificates
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
EXPOSE 5000 EXPOSE 5000
RUN apk add gosu \ RUN apk add gosu \

View File

@ -1,7 +1,7 @@
############################################### ###############################################
# Build stage # # Build stage #
############################################### ###############################################
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build
# Docker buildx supplies the value for this arg # Docker buildx supplies the value for this arg
ARG TARGETPLATFORM ARG TARGETPLATFORM
@ -9,11 +9,14 @@ ARG TARGETPLATFORM
# Determine proper runtime value for .NET # Determine proper runtime value for .NET
# We put the value in a file to be read by later layers. # We put the value in a file to be read by later layers.
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \ RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
RID=linux-x64 ; \ RID=linux-musl-x64 ; \
#RID=linux-x64 ; \
elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \ elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
RID=linux-arm64 ; \ RID=linux-musl-arm64 ; \
#RID=linux-arm64 ; \
elif [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then \ elif [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then \
RID=linux-arm ; \ RID=linux-musl-arm ; \
#RID=linux-arm ; \
fi \ fi \
&& echo "RID=$RID" > /tmp/rid.txt && echo "RID=$RID" > /tmp/rid.txt
@ -37,13 +40,14 @@ RUN . /tmp/rid.txt && dotnet publish \
############################################### ###############################################
# App stage # # App stage #
############################################### ###############################################
FROM cgr.dev/chainguard/wolfi-base:latest FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine
ARG TARGETPLATFORM ARG TARGETPLATFORM
LABEL com.bitwarden.product="bitwarden" LABEL com.bitwarden.product="bitwarden"
ENV ASPNETCORE_ENVIRONMENT=Production ENV ASPNETCORE_ENVIRONMENT=Production
ENV ASPNETCORE_URLS=http://+:5000 ENV ASPNETCORE_URLS=http://+:5000
ENV SSL_CERT_DIR=/etc/bitwarden/ca-certificates ENV SSL_CERT_DIR=/etc/bitwarden/ca-certificates
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
EXPOSE 5000 EXPOSE 5000
RUN apk add gosu \ RUN apk add gosu \

View File

@ -1,7 +1,7 @@
############################################### ###############################################
# Build stage # # Build stage #
############################################### ###############################################
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build
# Docker buildx supplies the value for this arg # Docker buildx supplies the value for this arg
ARG TARGETPLATFORM ARG TARGETPLATFORM
@ -9,11 +9,14 @@ ARG TARGETPLATFORM
# Determine proper runtime value for .NET # Determine proper runtime value for .NET
# We put the value in a file to be read by later layers. # We put the value in a file to be read by later layers.
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \ RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
RID=linux-x64 ; \ RID=linux-musl-x64 ; \
#RID=linux-x64 ; \
elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \ elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
RID=linux-arm64 ; \ RID=linux-musl-arm64 ; \
#RID=linux-arm64 ; \
elif [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then \ elif [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then \
RID=linux-arm ; \ RID=linux-musl-arm ; \
#RID=linux-arm ; \
fi \ fi \
&& echo "RID=$RID" > /tmp/rid.txt && echo "RID=$RID" > /tmp/rid.txt
@ -37,13 +40,14 @@ RUN . /tmp/rid.txt && dotnet publish \
############################################### ###############################################
# App stage # # App stage #
############################################### ###############################################
FROM cgr.dev/chainguard/wolfi-base:latest FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine
ARG TARGETPLATFORM ARG TARGETPLATFORM
LABEL com.bitwarden.product="bitwarden" LABEL com.bitwarden.product="bitwarden"
ENV ASPNETCORE_ENVIRONMENT=Production ENV ASPNETCORE_ENVIRONMENT=Production
ENV ASPNETCORE_URLS=http://+:5000 ENV ASPNETCORE_URLS=http://+:5000
ENV SSL_CERT_DIR=/etc/bitwarden/ca-certificates ENV SSL_CERT_DIR=/etc/bitwarden/ca-certificates
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
EXPOSE 5000 EXPOSE 5000
RUN apk add gosu \ RUN apk add gosu \

View File

@ -1,18 +1,21 @@
############################################### ###############################################
# Build stage # # Build stage #
############################################### ###############################################
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build
# Docker buildx supplies the value for this arg # Docker buildx supplies the value for this arg
ARG TARGETPLATFORM ARG TARGETPLATFORM
# Determine proper runtime value for .NET # Determine proper runtime value for .NET
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \ RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
RID=linux-x64 ; \ RID=linux-musl-x64 ; \
#RID=linux-x64 ; \
elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \ elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
RID=linux-arm64 ; \ RID=linux-musl-arm64 ; \
#RID=linux-arm64 ; \
elif [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then \ elif [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then \
RID=linux-arm ; \ RID=linux-musl-arm ; \
#RID=linux-arm ; \
fi \ fi \
&& echo "RID=$RID" > /tmp/rid.txt && echo "RID=$RID" > /tmp/rid.txt
@ -36,13 +39,14 @@ RUN . /tmp/rid.txt && dotnet publish \
############################################### ###############################################
# App stage # # App stage #
############################################### ###############################################
FROM cgr.dev/chainguard/wolfi-base:latest FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine
ARG TARGETPLATFORM ARG TARGETPLATFORM
LABEL com.bitwarden.product="bitwarden" LABEL com.bitwarden.product="bitwarden"
ENV ASPNETCORE_ENVIRONMENT=Production ENV ASPNETCORE_ENVIRONMENT=Production
ENV ASPNETCORE_URLS=http://+:5000 ENV ASPNETCORE_URLS=http://+:5000
ENV SSL_CERT_DIR=/etc/bitwarden/ca-certificates ENV SSL_CERT_DIR=/etc/bitwarden/ca-certificates
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
EXPOSE 5000 EXPOSE 5000
RUN apk add gosu \ RUN apk add gosu \

View File

@ -1,7 +1,7 @@
############################################### ###############################################
# Build stage # # Build stage #
############################################### ###############################################
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build
# Docker buildx supplies the value for this arg # Docker buildx supplies the value for this arg
ARG TARGETPLATFORM ARG TARGETPLATFORM
@ -9,11 +9,14 @@ ARG TARGETPLATFORM
# Determine proper runtime value for .NET # Determine proper runtime value for .NET
# We put the value in a file to be read by later layers. # We put the value in a file to be read by later layers.
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \ RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
RID=linux-x64 ; \ RID=linux-musl-x64 ; \
#RID=linux-x64 ; \
elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \ elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
RID=linux-arm64 ; \ RID=linux-musl-arm64 ; \
#RID=linux-arm64 ; \
elif [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then \ elif [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then \
RID=linux-arm ; \ RID=linux-musl-arm ; \
#RID=linux-arm ; \
fi \ fi \
&& echo "RID=$RID" > /tmp/rid.txt && echo "RID=$RID" > /tmp/rid.txt
@ -37,13 +40,14 @@ RUN . /tmp/rid.txt && dotnet publish \
############################################### ###############################################
# App stage # # App stage #
############################################### ###############################################
FROM cgr.dev/chainguard/wolfi-base:latest FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/aspnet:8.0-alpine
ARG TARGETPLATFORM ARG TARGETPLATFORM
LABEL com.bitwarden.product="bitwarden" LABEL com.bitwarden.product="bitwarden"
ENV ASPNETCORE_ENVIRONMENT=Production ENV ASPNETCORE_ENVIRONMENT=Production
ENV ASPNETCORE_URLS=http://+:5000 ENV ASPNETCORE_URLS=http://+:5000
ENV SSL_CERT_DIR=/etc/bitwarden/ca-certificates ENV SSL_CERT_DIR=/etc/bitwarden/ca-certificates
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
EXPOSE 5000 EXPOSE 5000
RUN apk add gosu \ RUN apk add gosu \

View File

@ -1,7 +1,7 @@
############################################### ###############################################
# Build stage # # Build stage #
############################################### ###############################################
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build
# Docker buildx supplies the value for this arg # Docker buildx supplies the value for this arg
ARG TARGETPLATFORM ARG TARGETPLATFORM
@ -9,11 +9,14 @@ ARG TARGETPLATFORM
# Determine proper runtime value for .NET # Determine proper runtime value for .NET
# We put the value in a file to be read by later layers. # We put the value in a file to be read by later layers.
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \ RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
RID=linux-x64 ; \ RID=linux-musl-x64 ; \
#RID=linux-x64 ; \
elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \ elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
RID=linux-arm64 ; \ RID=linux-musl-arm64 ; \
#RID=linux-arm64 ; \
elif [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then \ elif [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then \
RID=linux-arm ; \ RID=linux-musl-arm ; \
#RID=linux-arm ; \
fi \ fi \
&& echo "RID=$RID" > /tmp/rid.txt && echo "RID=$RID" > /tmp/rid.txt
@ -37,13 +40,14 @@ RUN . /tmp/rid.txt && dotnet publish \
############################################### ###############################################
# App stage # # App stage #
############################################### ###############################################
FROM cgr.dev/chainguard/wolfi-base:latest FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine
ARG TARGETPLATFORM ARG TARGETPLATFORM
LABEL com.bitwarden.product="bitwarden" LABEL com.bitwarden.product="bitwarden"
ENV ASPNETCORE_ENVIRONMENT=Production ENV ASPNETCORE_ENVIRONMENT=Production
ENV ASPNETCORE_URLS=http://+:5000 ENV ASPNETCORE_URLS=http://+:5000
ENV SSL_CERT_DIR=/etc/bitwarden/ca-certificates ENV SSL_CERT_DIR=/etc/bitwarden/ca-certificates
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
EXPOSE 5000 EXPOSE 5000
RUN apk add gosu \ RUN apk add gosu \

View File

@ -1,7 +1,7 @@
############################################### ###############################################
# Build stage # # Build stage #
############################################### ###############################################
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build
# Docker buildx supplies the value for this arg # Docker buildx supplies the value for this arg
ARG TARGETPLATFORM ARG TARGETPLATFORM
@ -9,11 +9,14 @@ ARG TARGETPLATFORM
# Determine proper runtime value for .NET # Determine proper runtime value for .NET
# We put the value in a file to be read by later layers. # We put the value in a file to be read by later layers.
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \ RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
RID=linux-x64 ; \ RID=linux-musl-x64 ; \
#RID=linux-x64 ; \
elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \ elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
RID=linux-arm64 ; \ RID=linux-musl-arm64 ; \
#RID=linux-arm64 ; \
elif [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then \ elif [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then \
RID=linux-arm ; \ RID=linux-musl-arm ; \
#RID=linux-arm ; \
fi \ fi \
&& echo "RID=$RID" > /tmp/rid.txt && echo "RID=$RID" > /tmp/rid.txt
@ -38,20 +41,26 @@ RUN . /tmp/rid.txt && dotnet publish \
############################################### ###############################################
# App stage # # App stage #
############################################### ###############################################
FROM mcr.microsoft.com/dotnet/aspnet:8.0 FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine
ARG TARGETPLATFORM ARG TARGETPLATFORM
LABEL com.bitwarden.product="bitwarden" LABEL com.bitwarden.product="bitwarden"
ENV ASPNETCORE_ENVIRONMENT=Production ENV ASPNETCORE_ENVIRONMENT=Production
ENV ASPNETCORE_URLS=http://+:5000 ENV ASPNETCORE_URLS=http://+:5000
ENV SSL_CERT_DIR=/etc/bitwarden/ca-certificates ENV SSL_CERT_DIR=/etc/bitwarden/ca-certificates
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
EXPOSE 5000 EXPOSE 5000
RUN apt-get update \ # RUN apt-get update \
&& apt-get install -y --no-install-recommends \ # && apt-get install -y --no-install-recommends \
gosu \ # gosu \
curl \ # curl \
&& rm -rf /var/lib/apt/lists/* # && 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 \
&& rm -rf /var/cache/apk/*
# Copy app from the build stage # Copy app from the build stage
WORKDIR /bitwarden_server WORKDIR /bitwarden_server

View File

@ -1,7 +1,7 @@
############################################### ###############################################
# Build stage # # Build stage #
############################################### ###############################################
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-alpline AS build
# Docker buildx supplies the value for this arg # Docker buildx supplies the value for this arg
ARG TARGETPLATFORM ARG TARGETPLATFORM
@ -9,11 +9,14 @@ ARG TARGETPLATFORM
# Determine proper runtime value for .NET # Determine proper runtime value for .NET
# We put the value in a file to be read by later layers. # We put the value in a file to be read by later layers.
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \ RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
RID=linux-x64 ; \ RID=linux-musl-x64 ; \
#RID=linux-x64 ; \
elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \ elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
RID=linux-arm64 ; \ RID=linux-musl-arm64 ; \
#RID=linux-arm64 ; \
elif [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then \ elif [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then \
RID=linux-arm ; \ RID=linux-musl-arm ; \
#RID=linux-arm ; \
fi \ fi \
&& echo "RID=$RID" > /tmp/rid.txt && echo "RID=$RID" > /tmp/rid.txt
@ -38,18 +41,23 @@ RUN . /tmp/rid.txt && dotnet publish \
############################################### ###############################################
# App stage # # App stage #
############################################### ###############################################
FROM mcr.microsoft.com/dotnet/aspnet:8.0 FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine
ARG TARGETPLATFORM ARG TARGETPLATFORM
LABEL com.bitwarden.product="bitwarden" com.bitwarden.project="setup" LABEL com.bitwarden.product="bitwarden" com.bitwarden.project="setup"
ENV SSL_CERT_DIR=/etc/bitwarden/ca-certificates ENV SSL_CERT_DIR=/etc/bitwarden/ca-certificates
RUN apt-get update \ # RUN apt-get update \
&& apt-get install -y --no-install-recommends \ # && apt-get install -y --no-install-recommends \
# openssl \
# gosu \
# && rm -rf /var/lib/apt/lists/*
RUN apk add curl \
openssl \ openssl \
gosu \ && apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community gosu \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/cache/apk/*
# Copy app from the build stage # Copy app from the build stage
WORKDIR /app WORKDIR /app