Coder Social home page Coder Social logo

Comments (8)

marrobi avatar marrobi commented on June 8, 2024

@SJaffa hmm, the file is mounted in, as docker is running on your host machine so can't be edited just in the container.

What happens if you comment out the line specified above in the script? I've not hit the issue personally and it was added a fair while ago and the comment says it's specific to mac OS and codespaces.

This feels like more of a generic "How do I run docker inside a dev container without having to use sudo on mac OS and codespaces" question. Rather than TRE specific.

@stuartleeks shot in the dark, any ideas? Thanks.

from azuretre.

SJaffa avatar SJaffa commented on June 8, 2024

If I comment that line out (or just stop it running that script entirely when it does make all) then nothing else seems to break but I am having some other Docker issues so not sure if that is related or not at the moment. When I fix my other issue I'll check if this was related or not.

from azuretre.

marrobi avatar marrobi commented on June 8, 2024

Actually, I've just replicated it on my machine, WSL:

➜  ~ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.3 LTS
Release:        22.04
Codename:       jammy

I only upgraded last week, not noticed it before. I can confirm docker group ID in WSL is different to that in the container.

from azuretre.

marrobi avatar marrobi commented on June 8, 2024

I can confirm if I stop that script running I see no adverse affects, and docker permissions do not get broken.

from azuretre.

SJaffa avatar SJaffa commented on June 8, 2024

Yep just solved my other devcontainer/docker issue and it was unrelated, so I think removing this script is fine for me, but is there a way to stop this breaking things for anyone else on Linux? Or a different way to fix the original macOS/codespaces problem?

from azuretre.

marrobi avatar marrobi commented on June 8, 2024

Have verified that the script is needed on codespaces.

The only solution I can think of at present is to parse something from say docker info to only run the command in certain scenarios.

from azuretre.

marrobi avatar marrobi commented on June 8, 2024

In code spaces, we can check for:

CODESPACES=true

Actually, we could just run docker ps and check the exit code.

if ! docker ps > /dev/null 2>&1; then
  echo "docker ps failed, setting docker.sock permissions"
  sudo chgrp docker /var/run/docker.sock
  sudo chmod g+rw /var/run/docker.sock
fi

from azuretre.

marrobi avatar marrobi commented on June 8, 2024

I've done a PR, maybe you can test the fix and let me know. Thanks.

from azuretre.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.