Skip to content

Commit

Permalink
jupyter apt issues (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Ritchie authored Jun 19, 2020
1 parent 74fe00a commit a912775
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
8 changes: 4 additions & 4 deletions caliban/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ def __str__(self) -> str:
def apt_install(*packages: str) -> str:
"""Returns a command that will install the supplied list of packages without
requiring confirmation or any user interaction.
"""
package_str = ' '.join(packages)
return "apt-get install --yes --no-install-recommends {}".format(package_str)
no_prompt = "DEBIAN_FRONTEND=noninteractive"
return f"{no_prompt} apt-get install --yes --no-install-recommends {package_str}"


def apt_command(commands: List[str]) -> List[str]:
Expand All @@ -107,7 +107,7 @@ def apt_command(commands: List[str]) -> List[str]:
"""
update = ["apt-get update"]
cleanup = ["rm -rf /var/lib/apt/lists/*"]
cleanup = ["apt-get clean", "rm -rf /var/lib/apt/lists/*"]
return update + commands + cleanup


Expand Down Expand Up @@ -1025,7 +1025,7 @@ def run_notebook(job_mode: c.JobMode,
docker_args = ["-p", "{}:{}".format(port, port)] + run_args

run_interactive(job_mode,
entrypoint="/opt/venv/bin/python",
entrypoint="/opt/conda/envs/caliban/bin/python",
entrypoint_args=jupyter_args,
run_args=docker_args,
inject_notebook=inject_arg,
Expand Down
7 changes: 4 additions & 3 deletions dockerfiles/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,15 @@ LABEL maintainer="[email protected]"
ENV LANG C.UTF-8

# Install git so that users can declare git dependencies, and python3 plus
# python3-venv so we can generate an isolated Python environment inside
# python3-virtualenv so we can generate an isolated Python environment inside
# the container.
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
python3 \
python3-virtualenv \
wget && \
rm -rf /var/lib/apt/lists/*
wget \
&& apt-get clean && \
&& rm -rf /var/lib/apt/lists/*

# Some tools expect a "python" binary.
RUN ln -s $(which python3) /usr/local/bin/python
Expand Down

0 comments on commit a912775

Please sign in to comment.