question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Figure out how to run Firefox better

See original GitHub issue
  • right now the only way to run Firefox is to use --user 1001 to match the permissions GH sets when creating a home folder for the user
container:
  image: cypress/browsers:node12.16.1-chrome80-ff73
  options: --user 1001
docker.io/cypress/browsers:node12.16.1-chrome80-ff73
/usr/bin/docker create --name 9841aeea80f6424291fc77ef4b420dd6_cypressbrowsersnode12161chrome80ff73_ee5fd3 
--label e87b52 
--workdir /__w/github-action/github-action 
--network github_network_7218f6f710d149c59f24a8cab63bbe10  
-e "HOME=/github/home"

Permissions on the home folder

Run ls -la /github/home
total 8
drwxr-xr-x 2 1001  115 4096 Mar  5 15:33 .
drwxr-xr-x 4 root root 4096 Mar  5 15:33 ..

It would be nice to run with any non-root user, for example our cypress-docker-images have node user with id 1000.

PS: the 1001 user works but has group id of 0

$ id
uid=1001 gid=0(root) groups=0(root)

Preferred

container:
  image: cypress/browsers:node12.16.1-chrome80-ff73
  options: --user node

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
KleisKlasKlusscommented, Feb 3, 2022

I was running into issues with a custom docker container for the job using --user 1001 because of permissions of the files created in the build stage of the container (in the dockerfile).

I found a solution that I could imagine may very well break some other stuff haha, but it doesn’t look like it’s breaking any of my things I need to do anyway! For my usecase it seems a lot less intrusive and in case it is for others as well I just wanted to share.

And that was simply to have

jobs:
  job-name:
    env:
      HOME: ""

And it’s important not just to do it for the cypress step because then in the install steps it seems like Cypress installs something in the home folders that it needs and it breaks Cypress, if you have it through the whole job like this though, it works perfectly 😃.

When HOME is set to empty string Firefox allows you to run it as root nicely, and I can keep all the permissions to access my files in the container easily

Thanks @emilgoldsmith! 🎉 This solved a similar issue that I’ve been struggling with for quite some time.

0reactions
josh803316commented, May 10, 2022

@KleisKlasKluss and @emilgoldsmith I’ve been running into issues with a custom self-hosted runner (building the image and setting up the environment myself). What does setting “HOME” empty do for the run as user 1001? When I build the AMI image I only have 2 users (ec2-user and ssm-user) – and the docker container gets layered in after (I think). Anyway I don’t have a 1001 user when I’m running the install so I’m curious about how this maps to the environment and PATH.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Firefox's performance settings - Mozilla Support
In the Menu bar at the top of the screen, click Firefox and select Preferences.Click the menu button Fx89menuButton and select Settings. ·...
Read more >
10 Simple Tweaks to Speed up Firefox to 5 Times Faster
1) Go to about:preferences. · 2) In General, scroll down to Performance. · 3) Uncheck the box Use recommended performance settings. · 4)...
Read more >
10 Ways to Speed Up Firefox Browser and Boost Performance
Open Firefox, and then type “about:preferences” into the address bar. · Stay on the General tab, and then scroll down until you see...
Read more >
How To Increase Firefox Page Loading Speed - GreenGeeks
Visit “about:preferences#advanced” in a new tab. Check or uncheck “Use hardware acceleration.” Unlike most setting changes, you may need to restart Firefox for ......
Read more >
9 Easy Ways to Speed Up Firefox in Less than 10 Minutes
Your browser can't play this video. Learn more. Switch camera.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found