Allow the use of sudo in the docker container
This commit is contained in:
parent
9782d3499c
commit
bb217047a1
2 changed files with 13 additions and 1 deletions
|
@ -2,7 +2,9 @@ version: '3'
|
|||
|
||||
services:
|
||||
silverstripe:
|
||||
image: manuth/silverstripe-dev
|
||||
build:
|
||||
context: .
|
||||
dockerfile: web.Dockerfile
|
||||
env_file: devcontainer.env
|
||||
environment:
|
||||
- SS_ENVIRONMENT_TYPE=dev
|
||||
|
|
10
.devcontainer/web.Dockerfile
Normal file
10
.devcontainer/web.Dockerfile
Normal file
|
@ -0,0 +1,10 @@
|
|||
FROM manuth/silverstripe-dev
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get -y install sudo && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN adduser --disabled-password --gecos '' vscode && \
|
||||
sed -i /etc/sudoers -re 's/^%sudo.*/%sudo ALL=(ALL:ALL) NOPASSWD: ALL/g' && \
|
||||
sed -i /etc/sudoers -re 's/^root.*/root ALL=(ALL:ALL) NOPASSWD: ALL/g' && \
|
||||
echo 'vscode ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
|
Loading…
Reference in a new issue