Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[universal] - Issue universal config change for non-root default codespace user in universal image #1287

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
3 changes: 2 additions & 1 deletion src/universal/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@
],
"remoteUser": "codespace",
"containerUser": "codespace",

"updateRemoteUserUID": false,
"postStartCommand": "sudo chown -R 1000:1000 /workspaces/images/",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May I know why this need to be a postStartCommand?
postStartCommand re runs on every time container is restarted. We need to do this work only once

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

Expand Down
13 changes: 13 additions & 0 deletions src/universal/test-project/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,19 @@ check "zsh" zsh --version
check "RAILS_DEVELOPMENT_HOSTS is set correctly" echo $RAILS_DEVELOPMENT_HOSTS | grep ".githubpreview.dev,.preview.app.github.dev,.app.github.dev"

# Check that we can run a puppeteer node app.
# installing google chrome for puppeteer
cd /
sudo wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome-stable_current_amd64.deb

cd /opt/google/chrome/
sudo chown root:root chrome-sandbox
sudo chmod 4755 chrome-sandbox
sudo cp -p chrome-sandbox /usr/local/sbin/chrome-devel-sandbox

# export CHROME_DEVEL_SANDBOX env variable
export CHROME_DEVEL_SANDBOX=/usr/local/sbin/chrome-devel-sandbox
cd /workspaces/images/src/universal/test-project/
yarn
check "run-puppeteer" node puppeteer.js
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this command work on the container when the user runs it?
Or is it passing here because the additional setup done above, before running the check?


Expand Down
Loading