Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.

Commit ddcef1f

Browse files
committed
Run docker image as root
1 parent dec013b commit ddcef1f

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

.dockerignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@
77
**/*.sample.*
88
tmp/
99
**/.env
10-
**/*.md
10+
**/*.md
11+
docker-compose.yml

Dockerfile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,16 @@ RUN apk add --no-cache libsecret dbus gnome-keyring libcap &&\
2828
dbus-uuidgen > /var/lib/dbus/machine-id &&\
2929
setcap cap_ipc_lock=+ep $(which gnome-keyring-daemon)
3030

31-
RUN addgroup mgc &&\
32-
adduser -D -G mgc -h /app mgc
31+
# TODO: Find work-around for running image as a non-root user.
32+
# Docker doesn't support adding capabilities to non-root users. See https://training.play-with-docker.com/security-capabilities/
3333

3434
WORKDIR /app
3535

3636
COPY --from=build-env /app/output ./dist
3737

3838
RUN ln -s /app/dist/mgc /usr/bin/mgc
3939

40-
USER mgc
41-
42-
COPY --chown=mgc:mgc ./docker/* ./dist/
40+
COPY ./docker/* ./dist/
4341

4442
RUN mkdir -p /app/.mgc /app/.local/share/.IdentityService /app/.local/share/keyrings &&\
4543
chmod +x /app/dist/init.sh

0 commit comments

Comments
 (0)