repo2docker: repo2docker hangs on local install
Running latest repo2docker fresh from pypi:
FROM buildpack-deps:artful
# Set up locales properly
RUN apt-get update && \
apt-get install --yes --no-install-recommends locales && \
apt-get purge && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && \
locale-gen
ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
# Use bash as default shell, rather than sh
ENV SHELL /bin/bash
# Set up user
ARG NB_USER
ARG NB_UID
ENV USER ${NB_USER}
ENV HOME /home/${NB_USER}
RUN adduser --disabled-password \
--gecos "Default user" \
--uid ${NB_UID} \
${NB_USER}
WORKDIR ${HOME}
RUN apt-get update && \
apt-get install --yes --no-install-recommends \
less \
npm \
&& apt-get purge && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN apt-get update && \
apt-get install --yes \
python3 \
python3-dev \
python3-venv \
&& apt-get purge && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
EXPOSE 8888
# Almost all environment variables
ENV APP_BASE /srv
ENV VENV_PATH ${APP_BASE}/venv
ENV NB_PYTHON_PREFIX ${VENV_PATH}
# Special case PATH
ENV PATH ${VENV_PATH}/bin:${PATH}
# If scripts required during build are present, copy them
COPY python/requirements.frozen.txt /tmp/requirements.frozen.txt
RUN mkdir -p ${VENV_PATH} && \
chown -R ${NB_USER}:${NB_USER} ${VENV_PATH}
USER ${NB_USER}
RUN python3 -m venv ${VENV_PATH}
RUN pip install --no-cache-dir -r /tmp/requirements.frozen.txt && \
jupyter nbextension enable --py widgetsnbextension --sys-prefix && \
jupyter serverextension enable --py jupyterlab --sys-prefix && \
jupyter serverextension enable nteract_on_jupyter --sys-prefix
# 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
COPY src/ ${HOME}
RUN chown -R ${NB_USER}:${NB_USER} ${HOME}
# Run assemble scripts! These will actually build the specification
# in the repository into the image.
RUN apt-get update && \
apt-get install --yes --no-install-recommends pandoc texlive-latex-base texlive-latex-recommended texlive-science texlive-latex-extra texlive-fonts-recommended dvipng ghostscript && \
apt-get purge && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
USER ${NB_USER}
RUN pip3 install --no-cache-dir -r "requirements.txt"
# Container image Labels!
# Put these at the end, since we don't want to rebuild everything
# when these change! Did I mention I hate Dockerfile cache semantics?
# We always want containers to run as non-root
USER ${NB_USER}
RUN ./postBuild
Using PythonBuildPack builder
Step 1/33 : FROM buildpack-deps:artful
---> 15aabadeaee6
Step 2/33 : RUN apt-get update && apt-get install --yes --no-install-recommends locales && apt-get purge && apt-get clean && rm -rf /var/lib/apt/lists/*
---> Using cache
---> a503cac6c9ac
Step 3/33 : RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && locale-gen
---> Using cache
---> 2f62ac8d042a
Step 4/33 : ENV LC_ALL en_US.UTF-8
---> Using cache
---> 5246ca660498
Step 5/33 : ENV LANG en_US.UTF-8
---> Using cache
---> 46d5ee905d85
Step 6/33 : ENV LANGUAGE en_US.UTF-8
---> Using cache
---> 25ca381c1ccb
Step 7/33 : ENV SHELL /bin/bash
---> Using cache
---> 2f3e4d95e5a6
Step 8/33 : ARG NB_USER
---> Using cache
---> d0da0c76273f
Step 9/33 : ARG NB_UID
---> Using cache
---> 23f9d9d773c6
Step 10/33 : ENV USER ${NB_USER}
---> Using cache
---> 996af037e629
Step 11/33 : ENV HOME /home/${NB_USER}
---> Using cache
---> 09634520cc8c
Step 12/33 : RUN adduser --disabled-password --gecos "Default user" --uid ${NB_UID} ${NB_USER}
---> Running in 14bb574a0353
Adding user `ajh59' ...
Adding new group `ajh59' (494230618) ...
Adding new user `ajh59' (494230618) with group `ajh59' ...
Creating home directory `/home/ajh59' ...
Copying files from `/etc/skel' ...
and then it just hangs. It also seems to break my docker install by using up all memory, though I can’t see where. I wonder if the copy could be infinitely stuck somehow?
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 1
- Comments: 52 (23 by maintainers)
I might’ve stumbled upon the cause: https://github.com/moby/moby/issues/5419
It sounds like it depends on the capabilities of your Docker host, and whether sparse files are supported:
In this case if your system doesn’t support sparse files
adduserwill attempt to create a 1.2 TB file!I’ve got a PR but the tests are failing: https://github.com/jupyter/repo2docker/pull/804
@betatim sorry for the confusion. You’re right:
This is the same as the default behavior that doesn’t work for us.
repo2docker --user-id `id -u` https://github.com/willingc/ThinkDSPPassing a
uidvalue of 1000 like this, does work for us.repo2docker --user-id 1000 https://github.com/willingc/ThinkDSP@psychemedia and @juanesarango could you try if providing
--uid 1000as command-line option when you runrepo2dockerfixes the problem and tell us what your user ID is (runidto find out)?By default repo2docker will use the UID of your local user when it adds the user to the image.
The fact that the patch in #323 fixes the problem suggests that UID 1000 should work. It is a bit of a mystery why it does not work with your local user’s ID.
@betatim I followed
https://github.com/jupyter/repo2docker/issues/223#issuecomment-384289185exactly. No commands more or less, other than ctrl-c to break from the hang.Thinks… hang on, I’ll try and run it again in a path I’ve checked that guarantees no spaces… … ah, I did, the above code was run in:
/Users/ajh59/r2d2test/repo2docker