GithubHelp home page GithubHelp logo

Comments (4)

zachmullen avatar zachmullen commented on July 18, 2024 1

@jcfr beat me to it :)

from girder_worker.

jcfr avatar jcfr commented on July 18, 2024

Assuming the docker images you are running does not already have an entrypoint, you could do something like this:

docker run -e USER_ID=$(id -u) -e GROUP_ID=$(id -g) -v /path/to/docker_entrypoint.sh:/root/docker_entrypoint.sh:ro --entrypoint /root/docker_entrypoint.sh  imagename command args

See also https://docs.docker.com/engine/reference/run/#entrypoint-default-command-to-execute-at-runtime

You could generalize the docker_entrypoint.sh I created by adding it to girder_worker repo. May be a new name could be docker_userconf_entrypoint.sh ?

On a related topic: https://github.com/rocker-org/rocker/wiki/Sharing-files-with-host-machine

from girder_worker.

zachmullen avatar zachmullen commented on July 18, 2024

Is there some way inside your image to make it so that matplotlib doesn't try to lookup the user from the password database? It looks like it's trying to create a temp directory and wants to include the user's name in the directory name, is there maybe some way to explicitly instruct matplotlib (maybe via environment variable) to not do this behavior?

There is a general solution to this that would support container operations performing system user lookups, but it's dirty. Namely, we could inject a shell script into the container via the temp dir mounted volume. This script would first create a new user with the given UID if one did not already exist, then the script would delete itself and run whatever the client-specified entrypoint was.

Let me know if you foresee any problems with that hack, or if there is an easier way.

from girder_worker.

jcfr avatar jcfr commented on July 18, 2024

Cc: @thewtex

from girder_worker.

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.