Skip to content

Commit 851a352

Browse files
authored
Merge pull request #13 from posit-dev/fix-azureml-auth
Remove `ubuntu` user from WAML image
2 parents 39a16cc + 1699a3b commit 851a352

5 files changed

Lines changed: 40 additions & 3 deletions

File tree

workbench-for-microsoft-azure-ml/2026.04/Containerfile.ubuntu2404.min

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,12 @@ ENV DIAGNOSTIC_ONLY=false
3131

3232
COPY --chmod=0644 workbench-for-microsoft-azure-ml/2026.04/conf/license-manager/TurboActivate.dat /opt/rstudio-license/license-manager.conf
3333

34-
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
34+
SHELL ["/bin/bash", "-euo", "pipefail", "-c"]
35+
36+
### Remove ubuntu user ###
37+
# Ubuntu 24.04 assigns the uid 1000 to the ubuntu user. This is incompatible with the hardcoded PUID=1000 environment
38+
# variable set by Azure ML. By removing the ubuntu user, we can free up the 1000 uid entirely.
39+
RUN userdel -r ubuntu
3540

3641
### Setup environment ###
3742
RUN apt-get update -yqq --fix-missing && \
@@ -98,6 +103,8 @@ CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
98103

99104
FROM build AS clamav
100105

106+
SHELL ["/bin/bash", "-euo", "pipefail", "-c"]
107+
101108
# Set up ClamAV
102109
RUN apt-get update -yqq && \
103110
apt-get install -yqq --no-install-recommends \

workbench-for-microsoft-azure-ml/2026.04/Containerfile.ubuntu2404.std

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,12 @@ ENV DIAGNOSTIC_ONLY=false
3131

3232
COPY --chmod=0644 workbench-for-microsoft-azure-ml/2026.04/conf/license-manager/TurboActivate.dat /opt/rstudio-license/license-manager.conf
3333

34-
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
34+
SHELL ["/bin/bash", "-euo", "pipefail", "-c"]
35+
36+
### Remove ubuntu user ###
37+
# Ubuntu 24.04 assigns the uid 1000 to the ubuntu user. This is incompatible with the hardcoded PUID=1000 environment
38+
# variable set by Azure ML. By removing the ubuntu user, we can free up the 1000 uid entirely.
39+
RUN userdel -r ubuntu
3540

3641
### Setup environment ###
3742
RUN apt-get update -yqq --fix-missing && \
@@ -151,6 +156,8 @@ CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
151156

152157
FROM build AS clamav
153158

159+
SHELL ["/bin/bash", "-euo", "pipefail", "-c"]
160+
154161
# Set up ClamAV
155162
RUN apt-get update -yqq && \
156163
apt-get install -yqq --no-install-recommends \

workbench-for-microsoft-azure-ml/2026.04/test/goss.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,14 @@ file:
158158
{{ end }}
159159

160160

161+
# Check that Nginx configs are included
162+
/etc/rstudio/nginx.site.conf:
163+
exists: true
164+
/etc/rstudio/nginx.server.conf:
165+
exists: true
166+
/etc/rstudio/nginx.http.conf:
167+
exists: true
168+
161169
command:
162170
"Ensure rstudio-server has permissions to log directory":
163171
exec: su rstudio-server -c 'touch /var/lib/rstudio-server/monitor/log/rstudio-server.log'

workbench-for-microsoft-azure-ml/template/Containerfile.ubuntu2404.jinja2

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,12 @@ ENV DIAGNOSTIC_ONLY=false
3333

3434
COPY --chmod=0644 {{ Path.Version }}/conf/license-manager/TurboActivate.dat /opt/rstudio-license/license-manager.conf
3535

36-
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
36+
SHELL ["/bin/bash", "-euo", "pipefail", "-c"]
37+
38+
### Remove ubuntu user ###
39+
# Ubuntu 24.04 assigns the uid 1000 to the ubuntu user. This is incompatible with the hardcoded PUID=1000 environment
40+
# variable set by Azure ML. By removing the ubuntu user, we can free up the 1000 uid entirely.
41+
RUN userdel -r ubuntu
3742

3843
### Setup environment ###
3944
{{ apt.run_setup() }}
@@ -132,6 +137,8 @@ CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
132137

133138
FROM build AS clamav
134139

140+
SHELL ["/bin/bash", "-euo", "pipefail", "-c"]
141+
135142
# Set up ClamAV
136143
{{ apt.run_install("clamav") }}
137144

workbench-for-microsoft-azure-ml/template/test/goss.yaml.jinja2

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,14 @@ file:
170170
{{ end }}
171171
{% endraw %}
172172

173+
# Check that Nginx configs are included
174+
/etc/rstudio/nginx.site.conf:
175+
exists: true
176+
/etc/rstudio/nginx.server.conf:
177+
exists: true
178+
/etc/rstudio/nginx.http.conf:
179+
exists: true
180+
173181
command:
174182
"Ensure rstudio-server has permissions to log directory":
175183
exec: su rstudio-server -c 'touch /var/lib/rstudio-server/monitor/log/rstudio-server.log'

0 commit comments

Comments
 (0)