File tree Expand file tree Collapse file tree 2 files changed +1
-26
lines changed
Expand file tree Collapse file tree 2 files changed +1
-26
lines changed Original file line number Diff line number Diff line change @@ -3,11 +3,6 @@ FROM mcr.microsoft.com/playwright:v1.56.1-noble
33ARG DEBIAN_FRONTEND=noninteractive
44ARG TZ=UTC
55
6- # Add user args (defaults can be overridden via devcontainer.json build.args)
7- ARG USERNAME=serenity-js
8- ARG USER_UID=1000
9- ARG USER_GID=1000
10-
116ENV SHELL=/bin/bash
127ENV PATH="/opt/google/chrome:${PATH}"
138ENV HOME=/home/${USERNAME}
3429 apt-get clean && \
3530 rm -rf /var/lib/apt/lists/*
3631
37- # Create a non-root user to run the workspace (more secure than using root)
38- RUN set -eux; \
39- # create group (if it doesn't already exist) and user with specified uid/gid
40- if ! getent group ${USER_GID} >/dev/null 2>&1; then \
41- groupadd --gid ${USER_GID} ${USERNAME}; \
42- fi; \
43- if ! id -u ${USERNAME} >/dev/null 2>&1; then \
44- useradd -m -s /bin/bash -u ${USER_UID} -g ${USER_GID} ${USERNAME}; \
45- fi; \
46- # Ensure /workspaces exists and is owned by the non-root user so postCreateCommand can write
47- mkdir -p /workspaces; \
48- chown -R ${USERNAME}:${USERNAME} /workspaces /home/${USERNAME}
49-
5032# Copy welcome message for Codespaces/Dev Containers
5133COPY welcome-message.txt /usr/local/etc/vscode-dev-containers/first-run-notice.txt
5234
53- # Switch to the non-root user for the running container
54- USER ${USERNAME}
5535WORKDIR /workspaces
Original file line number Diff line number Diff line change 11{
22 "build" : {
33 "context" : " ." ,
4- "dockerfile" : " Dockerfile" ,
5- "args" : {
6- "USERNAME" : " serenity-js" ,
7- "USER_UID" : " 1002" ,
8- "USER_GID" : " 1002"
9- }
4+ "dockerfile" : " Dockerfile"
105 },
116
127 "features" : {
You can’t perform that action at this time.
0 commit comments