Skip to content

Commit

Permalink
adding new non-root gpuser user
Browse files Browse the repository at this point in the history
  • Loading branch information
bahill committed May 17, 2021
1 parent 2baf2e5 commit 5e3e49c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,26 @@ MAINTAINER Barbara Hill <bhill@broadinstitute.org>
# While you are debugging/iterating over your module code in the Module integrator comment out the secion below.
# When you are done, export your module, unzip and move your source files into the src directory in this local workspace.
# Then, update this section for you module and build using the docker build command below - again updated for your module.
# Note that you only need to add gpuser if you base image (the image specified in FROM) is run as root. If it runs as another user, you may need to become root (USER root) to add folders...etc. Just make sure to switch back to the non-root user before exiting.
# -----------------------------------
#creating a non-root user - see above
RUN useradd -ms /bin/bash gpuser
USER newuser
WORKDIR /home/newuser

#switch back to root to create dir
USER root
RUN mkdir /ExampleModule \
&& chown gpuser /ExampleModule

#switch to non-root before exiting so that we don't run as root on the server.
USER gpuser
COPY src/*.py /ExampleModule/

RUN /ExampleModule/ExampleModule.py
# -----------------------------------

# docker build --rm https://github.com/genepattern/ExampleModule#develop -f Dockerfile -t genepattern/example-module:2
# docker build --rm https://github.com/genepattern/ExampleModule.git#develop -f Dockerfile -t genepattern/example-module:2
# make sure this repo and tag match the manifest & don't forget to docker push!

# you can use this command to run Docker and iterate locally (update for your paths and module name, of course)
Expand Down

0 comments on commit 5e3e49c

Please sign in to comment.