Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ jobs:
dotnet: true
- project_name: MsSql
base_path: ./util
platforms: linux/amd64
- project_name: MsSqlMigratorUtility
base_path: ./util
dotnet: true
Expand Down
8 changes: 1 addition & 7 deletions util/MsSql/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
FROM mcr.microsoft.com/mssql/server:2025-CU5-ubuntu-22.04
FROM mcr.microsoft.com/mssql/rhel/server:2025-CU5-rhel-9.1

LABEL com.bitwarden.product="bitwarden"

USER root:root

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
gosu \
tzdata \
&& rm -rf /var/lib/apt/lists/*
Comment thread
mimartin12 marked this conversation as resolved.

COPY util/MsSql/backup-db.sql /
COPY util/MsSql/backup-db.sh /
COPY util/MsSql/entrypoint.sh /
Expand Down
7 changes: 5 additions & 2 deletions util/MsSql/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ 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

# setpriv, update the $HOME for the target user
export HOME=/home/$USERNAME

# Read the SA_PASSWORD value from a file for swarm environments.
# See https://github.com/Microsoft/mssql-docker/issues/326
if [ ! -z "$SA_PASSWORD" ] && [ ! -z "$SA_PASSWORD_FILE" ]
Expand Down Expand Up @@ -59,7 +62,7 @@ chown $USERNAME:$GROUPNAME /backup-db.sql
# Launch a loop to backup database on a daily basis
if [ "$BACKUP_DB" != "0" ]
then
gosu $USERNAME:$GROUPNAME /bin/sh -c "/backup-db.sh loop >/dev/null 2>&1 &"
setpriv --reuid $USERNAME --regid $GROUPNAME --init-groups /bin/sh -c "/backup-db.sh loop >/dev/null 2>&1 &"
fi

exec gosu $USERNAME:$GROUPNAME /opt/mssql/bin/sqlservr
exec setpriv --reuid $USERNAME --regid $GROUPNAME --init-groups /opt/mssql/bin/sqlservr
Loading