File: Dockerfile

package info (click to toggle)
ipyparallel 9.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 9,388 kB
  • sloc: python: 22,769; javascript: 267; makefile: 29; sh: 28
file content (44 lines) | stat: -rw-r--r-- 1,387 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# syntax = docker/dockerfile:1.2.1
FROM ubuntu:20.04
RUN --mount=type=cache,target=/var/cache/apt \
    rm -f /etc/apt/apt.conf.d/docker-clean \
 && apt-get update \
 && apt-get -y install \
        iputils-ping \
        bind9-utils \
        wget \
        openssh-server

ENV MAMBA_ROOT_PREFIX=/opt/conda
ENV PATH=$MAMBA_ROOT_PREFIX/bin:$PATH
ENV IPP_DISABLE_JS=1
# x86_64 -> 64, aarch64 unmodified
RUN ARCH=$(uname -m | sed s@x86_@@) \
 && wget -qO- https://github.com/mamba-org/micromamba-releases/releases/latest/download/micromamba-linux-${ARCH} > /usr/local/bin/micromamba \
 && chmod +x /usr/local/bin/micromamba

RUN --mount=type=cache,target=${MAMBA_ROOT_PREFIX}/pkgs \
    micromamba install -y -p $MAMBA_ROOT_PREFIX -c conda-forge \
        python=3.8 \
        pip \
        ipyparallel

# generate a user with home directory and trusted ssh keypair
RUN useradd -m -s /bin/bash -N ciuser
USER ciuser
RUN mkdir ~/.ssh \
 && chmod 0700 ~/.ssh \
 && ssh-keygen -q -t rsa -N '' -f /home/ciuser/.ssh/id_rsa \
 && cat ~/.ssh/id_rsa.pub > ~/.ssh/authorized_keys \
 && chmod 0600 ~/.ssh/*
USER root


ENV PIP_CACHE_DIR=/tmp/pip-cache
COPY . /src/ipyparallel
RUN --mount=type=cache,target=${PIP_CACHE_DIR} python3 -m pip install -e 'file:///src/ipyparallel#egg=ipyparallel[test]'

# needed for sshd to start
RUN mkdir /run/sshd
# run sshd in the foreground
CMD /usr/sbin/sshd -D -e