generated from blooop/python_template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.rocker
96 lines (73 loc) · 3.08 KB
/
Dockerfile.rocker
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
#This file was autogenerated by rockerc
# Preamble from extension [git]
# Preamble from extension [nvidia]
# Ubuntu 16.04 with nvidia-docker2 beta opengl support
FROM nvidia/opengl:1.0-glvnd-devel-ubuntu18.04 as glvnd
# Preamble from extension [deps]
# Preamble from extension [pixi]
# Preamble from extension [user]
# Preamble from extension [x11]
FROM ubuntu:22.04
USER root
# Snippet from extension [git]
# Snippet from extension [nvidia]
RUN apt-get update && apt-get install -y --no-install-recommends \
libglvnd0 \
libgl1 \
libglx0 \
libegl1 \
libgles2 \
&& rm -rf /var/lib/apt/lists/*
COPY --from=glvnd /usr/share/glvnd/egl_vendor.d/10_nvidia.json /usr/share/glvnd/egl_vendor.d/10_nvidia.json
ENV NVIDIA_VISIBLE_DEVICES ${NVIDIA_VISIBLE_DEVICES:-all}
ENV NVIDIA_DRIVER_CAPABILITIES ${NVIDIA_DRIVER_CAPABILITIES:-all}
# Snippet from extension [deps]
# INSTALLING APT DEPS: tools
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
git-lfs \
jq \
python3-pip \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# INSTALLING PIP DEPS: language-toolchain
RUN pip3 install -U \
hatch \
pip \
twine \
uv \
&& echo "pip"
# Snippet from extension [pixi]
RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# Snippet from extension [user]
# make sure sudo is installed to be able to give user sudo access in docker
RUN if ! command -v sudo >/dev/null; then \
apt-get update \
&& apt-get install -y sudo \
&& apt-get clean; \
fi
RUN existing_user_by_uid=`getent passwd "1000" | cut -f1 -d: || true` && \
if [ -n "${existing_user_by_uid}" ]; then userdel -r "${existing_user_by_uid}"; fi && \
existing_user_by_name=`getent passwd "ags" | cut -f1 -d: || true` && \
existing_user_uid=`getent passwd "ags" | cut -f3 -d: || true` && \
if [ -n "${existing_user_by_name}" ]; then find / -uid ${existing_user_uid} -exec chown -h 1000 {} + || true ; find / -gid ${existing_user_uid} -exec chgrp -h 1000 {} + || true ; fi && \
if [ -n "${existing_user_by_name}" ]; then userdel -r "${existing_user_by_name}"; fi && \
existing_group_by_gid=`getent group "1000" | cut -f1 -d: || true` && \
if [ -z "${existing_group_by_gid}" ]; then \
groupadd -g "1000" "ags"; \
fi && \
useradd --no-log-init --no-create-home --uid "1000" -s /bin/bash -c "austin,,," -g "1000" -d "/home/ags" "ags" && \
echo "ags ALL=NOPASSWD: ALL" >> /etc/sudoers.d/rocker
# Making sure a home directory exists if we haven't mounted the user's home directory explicitly
RUN mkdir -p "$(dirname "/home/ags")" && mkhomedir_helper ags
WORKDIR /home/ags
# Snippet from extension [x11]
USER ags
# User Snippet from extension [git]
# User Snippet from extension [nvidia]
# User Snippet from extension [deps]
# User Snippet from extension [pixi]
RUN curl -fsSL https://pixi.sh/install.sh | bash
RUN echo 'eval "$(pixi completion --shell bash)"' >> ~/.bashrc
# User Snippet from extension [user]
# User Snippet from extension [x11]