-
Notifications
You must be signed in to change notification settings - Fork 22
/
Dockerfile.master
106 lines (93 loc) · 3.59 KB
/
Dockerfile.master
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# syntax = edrevo/dockerfile-plus
# To make the above work, you need to add
# `export DOCKER_BUILDKIT=1` (without the back-tics)
# to your .rc (.zshrc/.bashrc) file. This is *only*
# needed when building from source. Otherwise just pull
# as below.
#--- Build from Jupyter-provided Minimal Install ---#
# export IMG_NM=sds:2024-silicon && docker build --platform linux/arm64 -t jreades/$IMG_NM --compress -f ./docker/Dockerfile.master .
# export IMG_NM=sds:2024-intel && docker build --platform linux/amd64 -t jreades/$IMG_NM --compress -f ./docker/Dockerfile.master .
FROM quay.io/jupyter/minimal-notebook:2024-09-09
#FROM --platform=linux/arm64 quay.io/jupyter/minimal-notebook:2024-09-09
#FROM --platform=linux/amd64 continuumio/miniconda3:23.10.0-1
LABEL maintainer="Jon Reades <j.reades@ucl.ac.uk>"
ARG TARGETPLATFORM
#ENV NB_USER = "$(echo `whoami`)"
#RUN echo ${NB_USER}
ENV yaml_nm 'conda.install.yml'
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
#--- Avoid weird build issue ---#
RUN mkdir -p /home/${NB_USER}/.cache/conda
#--- Base ---#
USER root
RUN apt-get update \
&& apt-get install --no-install-recommends -y \
# Seem to need gcc and g++ for ARM builds now b/c of spacy
gcc \
g++ \
musl-dev \
# Not in miniconda
# unzip \
&& apt-cache policy musl-dev
# Ideally we could skip the apt-get update
# if we knew where musl-dev is available to
# download.
#--- Install some fonts ---#
# To use web fonts: https://fonts.google.com/knowledge/using_type/using_web_fonts
# To load web fonts: https://fonts.google.com/knowledge/using_type/using_web_fonts_from_a_font_delivery_service
# For the HTML header:
# <link rel="preconnect" href="https://fonts.googleapis.com">
# <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
# <link href="https://fonts.googleapis.com/css2?family=Micro+5&display=swap" rel="stylesheet">
# <link href="https://fonts.googleapis.com/css2?family=Sedan:ital@0;1&display=swap" rel="stylesheet">
# <link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:ital,wght@0,200..900;1,200..900&display=swap" rel="stylesheet">
# For the Micro-5 font:
# .micro-5-regular {
# font-family: "Micro 5", sans-serif;
# font-weight: 400;
# font-style: normal;
# }
# .sedan-regular {
# font-family: "Sedan", serif;
# font-weight: 400;
# font-style: normal;
# }
# .sedan-regular-italic {
# font-family: "Sedan", serif;
# font-weight: 400;
# font-style: italic;
# }
# // <uniquifier>: Use a unique and descriptive class name
# // <weight>: Use a value from 200 to 900
# .source-code-pro-<uniquifier> {
# font-family: "Source Code Pro", monospace;
# font-optical-sizing: auto;
# font-weight: <weight>;
# font-style: normal;
# }
USER $NB_UID
ADD /fonts/*.zip /home/${NB_USER}/
RUN mkdir -p /home/${NB_USER}/.local/share/fonts/ \
&& sh -x \
&& for i in `ls /home/${NB_USER}/*.zip`; \
do \
unzip -o "$i"; \
mv *.ttf /home/${NB_USER}/.local/share/fonts/; \
rm "$i"; \
done \
\
\
&& chown -R ${NB_USER} /home/${NB_USER}/.local/share/fonts
#--- Quarto ---#
INCLUDE+ ./docker/Dockerfile.quarto
#--- Python ---#
INCLUDE+ ./docker/Dockerfile.python.install
#--- Configure startup params ---#
# Switch back to user to avoid accidental container runs as root
USER $NB_UID
# VSCode Extension Folder (optional usage)
RUN mkdir -p /home/$NB_USER/.vscode-server/extensions \
/home/$NB_USER/.vscode-server-insiders/extensions \
&& chown -R $NB_UID \
/home/$NB_USER/.vscode-server \
/home/$NB_USER/.vscode-server-insiders