Skip to content

Commit 06de689

Browse files
authored
use unprivileged nginx images (#2354)
Signed-off-by: Itai Segall <itai.segall@digitalasset.com>
1 parent f1604d1 commit 06de689

File tree

8 files changed

+44
-2
lines changed

8 files changed

+44
-2
lines changed

cluster/images/ans-web-ui/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,8 @@ COPY --from=splice app/splice-node/web-uis/ans /usr/share/nginx/html/
1414
COPY config.js /tmpl/config.js.tmpl
1515
COPY --chmod=500 docker-entrypoint.sh /custom-docker-entrypoint.sh
1616

17+
USER root
18+
RUN chown -R nginx:nginx /tmpl
19+
RUN chown nginx:nginx /custom-docker-entrypoint.sh
20+
RUN chown -R nginx:nginx /usr/share/nginx/html
21+
USER nginx

cluster/images/docs/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,9 @@ COPY --from=splice app/LICENSE .
1515
COPY script.js /tmpl/script.js.tmpl
1616
COPY --chmod=500 docker-entrypoint.sh /custom-docker-entrypoint.sh
1717
ENTRYPOINT ["/custom-docker-entrypoint.sh"]
18+
19+
USER root
20+
RUN chown -R nginx:nginx /tmpl
21+
RUN chown nginx:nginx /custom-docker-entrypoint.sh
22+
RUN chown -R nginx:nginx /usr/share/nginx/html
23+
USER nginx

cluster/images/scan-web-ui/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,8 @@ COPY --from=splice app/splice-node/web-uis/scan /usr/share/nginx/html/
1414
COPY config.js /tmpl/config.js.tmpl
1515
COPY --chmod=500 docker-entrypoint.sh /custom-docker-entrypoint.sh
1616

17+
USER root
18+
RUN chown -R nginx:nginx /tmpl
19+
RUN chown nginx:nginx /custom-docker-entrypoint.sh
20+
RUN chown -R nginx:nginx /usr/share/nginx/html
21+
USER nginx

cluster/images/splice-web-ui/Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
# Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
FROM nginx:1.28.0@sha256:e2d0edf0e20951a190fe2322e27c6d790c675e9ff0018ba493947972f816f567
4+
FROM nginxinc/nginx-unprivileged:1.29.0@sha256:3161d975277f6af7e171bdccf48e3469cab8e5788fa63767f6656d4bfb49549c
5+
6+
USER root
57

68
RUN apt-get update \
79
&& apt-get install -y tini \
810
&& apt-get clean \
911
&& rm -rf /var/lib/apt/lists/*
1012

13+
USER nginx
14+
1115
COPY default.conf /etc/nginx/conf.d/
1216

1317
ENTRYPOINT ["/usr/bin/tini", "--", "/custom-docker-entrypoint.sh"]

cluster/images/splitwell-web-ui/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,9 @@ LABEL org.opencontainers.image.base.name="splice-web-ui:${base_version}"
1313
COPY --from=splice app/splice-node/web-uis/splitwell /usr/share/nginx/html/
1414
COPY config.js /tmpl/config.js.tmpl
1515
COPY --chmod=500 docker-entrypoint.sh /custom-docker-entrypoint.sh
16+
17+
USER root
18+
RUN chown -R nginx:nginx /tmpl
19+
RUN chown nginx:nginx /custom-docker-entrypoint.sh
20+
RUN chown -R nginx:nginx /usr/share/nginx/html
21+
USER nginx

cluster/images/sv-web-ui/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,9 @@ LABEL org.opencontainers.image.base.name="splice-web-ui:${base_version}"
1313
COPY --chmod=500 docker-entrypoint.sh /custom-docker-entrypoint.sh
1414
COPY config.js /tmpl/config.js.tmpl
1515
COPY --from=splice app/splice-node/web-uis/sv /usr/share/nginx/html/
16+
17+
USER root
18+
RUN chown -R nginx:nginx /tmpl
19+
RUN chown nginx:nginx /custom-docker-entrypoint.sh
20+
RUN chown -R nginx:nginx /usr/share/nginx/html
21+
USER nginx

cluster/images/wallet-web-ui/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,9 @@ LABEL org.opencontainers.image.base.name="splice-web-ui:${base_version}"
1313
COPY --from=splice app/splice-node/web-uis/wallet /usr/share/nginx/html/
1414
COPY config.js /tmpl/config.js.tmpl
1515
COPY --chmod=500 docker-entrypoint.sh /custom-docker-entrypoint.sh
16+
17+
USER root
18+
RUN chown -R nginx:nginx /tmpl
19+
RUN chown nginx:nginx /custom-docker-entrypoint.sh
20+
RUN chown -R nginx:nginx /usr/share/nginx/html
21+
USER nginx

docs/src/release_notes.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ Release Notes
1111
Upcoming
1212
--------
1313

14+
- Docker images
15+
16+
- All UI images now use a non-root user.
17+
18+
1419
0.4.18
1520
------
1621

@@ -43,7 +48,6 @@ Upcoming
4348

4449
- Implement changes from CIP-78 CC Fee Removal.
4550

46-
4751
0.4.17
4852
------
4953

0 commit comments

Comments
 (0)