kopia lustrzana https://github.com/jupyterhub/repo2docker
Put ${REPO_PATH}/.local/bin in PATH too
rodzic
21154d3b86
commit
29407aa83f
|
@ -102,6 +102,16 @@ ARG REPO_DIR=${HOME}
|
|||
ENV REPO_DIR ${REPO_DIR}
|
||||
WORKDIR ${REPO_DIR}
|
||||
|
||||
# We want to allow two things:
|
||||
# 1. If there's a .local/bin directory in the repo, things there
|
||||
# should automatically be in path
|
||||
# 2. postBuild and users should be able to install things into ~/.local/bin
|
||||
# and have them be automatically in path
|
||||
#
|
||||
# The XDG standard suggests ~/.local/bin as the path for local user-specific
|
||||
# installs. See https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
|
||||
ENV PATH ${HOME}/.local/bin:${REPO_DIR}/.local/bin:${PATH}
|
||||
|
||||
# Copy and chown stuff. This doubles the size of the repo, because
|
||||
# you can't actually copy as USER, only as root! Thanks, Docker!
|
||||
USER root
|
||||
|
@ -243,10 +253,7 @@ class BuildPack:
|
|||
Just sets the PATH environment variable. Separated out since
|
||||
it is very commonly set by various buildpacks.
|
||||
"""
|
||||
# Allow local user installs into ~/.local, which is where the
|
||||
# XDG desktop standard suggests these should be
|
||||
# See https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
|
||||
return ['$HOME/.local/bin']
|
||||
return []
|
||||
|
||||
def get_labels(self):
|
||||
"""
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# Verify that ~/.local/bin is on the PATH
|
||||
# Verify that ~/.local/bin & REPO_DIR/.local/bin is on the PATH
|
||||
import os
|
||||
|
||||
assert os.path.expanduser('~/.local/bin') in os.getenv("PATH"), os.getenv("PATH")
|
||||
assert os.getcwd() == os.environ['REPO_DIR']
|
||||
assert '{}/.local/bin'.format(os.environ['REPO_DIR']) in os.getenv('PATH')
|
||||
|
|
Ładowanie…
Reference in New Issue