File: Dockerfile.base

package info (click to toggle)
nvidia-cuda-toolkit 12.4.1-3
  • links: PTS, VCS
  • area: non-free
  • in suites: forky, sid
  • size: 18,505,836 kB
  • sloc: ansic: 203,477; cpp: 64,769; python: 34,699; javascript: 22,006; xml: 13,410; makefile: 3,085; sh: 2,343; perl: 352
file content (179 lines) | stat: -rw-r--r-- 4,638 bytes parent folder | download | duplicates (2)
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

FROM ubuntu:22.04

#
# avoid warnings by switching to noninteractive
ENV DEBIAN_FRONTEND=noninteractive

#
# set custom user
ARG USERNAME=nvidia
ARG PASSWORD=nvidia

ARG USER_UID=1000
ARG USER_GID=$USER_UID

#
# set default envs
ENV DISPLAY=:99.0
ENV USER=$USERNAME

ENV NEKO_PASSWORD=$PASSWORD
ENV NEKO_PASSWORD_ADMIN=$PASSWORD
ENV NEKO_BIND=:8080
ENV NEKO_IMPLICIT_CONTROL=true
ENV NEKO_SCREEN=$NEKO_SCREEN
ENV NEKO_PORT=8080
ENV NEKO_ICELITE=1
ENV NEKO_SCREEN=1920x1080@60
ENV NEKO_VIDEO_CODEC=vp8
ENV NEKO_VIDEO_BITRATE=6000
ENV NEKO_MAX_FPS=30
ENV NEKO_AUDIO_BITRATE=0
ENV RENDER_GID=

ENV OPENH264_DIR_NAME=/mnt/host/openh264
ENV GSTREAMER_VERSION=1.20.3

#
# do not collect NVIDIA DevTools telemetry in the Docker container
ENV NV_AGORA_DISABLE_TELEMETRY=1

#
# install dependencies
RUN set -eux; \
    apt-get update; \
    apt-get install -y --no-install-recommends \
    dbus \
    ca-certificates \
    supervisor \
    dbus-x11 \
    xserver-xorg-video-dummy \
    libxcb1 \
    libxrandr2 \
    libxtst6 \
    sudo \
    # gstreamer
    libgstreamer1.0-dev \
    libgstreamer-plugins-base1.0-dev \
    gstreamer1.0-plugins-base \
    gstreamer1.0-plugins-good \
    # package for hiding cursor
    unclutter \
    # window manager
    xfwm4 \
    # common libraries needed by NVIDIA DevTools
    libtinfo5 \
    libxcb-xinerama0 \
    libxcb-icccm4 \
    libxcb-image0 \
    libxcb-keysyms1 \
    libxcb-randr0 \
    libxcb-render-util0 \
    libxcb-xfixes0 \
    libxcb-shape0 \
    libxkbcommon-x11-0 \
    libxcb-xinput0 \
    libxcb-cursor0 \
    libnss3 \
    libxcomposite1 \
    libxdamage1 \
    libasound2 \
    libopengl0 \
    libegl1 \
    libgssapi-krb5-2 \
    libvpx7 \
    # clean up
    && rm -rf /var/lib/apt/lists/* /var/cache/apt/*

#
# create a non-root user
RUN set -eux; \
    groupadd --gid $USER_GID $USERNAME; \
    useradd --uid $USER_UID --gid $USERNAME --shell /bin/bash --create-home $USERNAME; \
    adduser $USERNAME video

#
# add user to sudoers
RUN set -eux; \
    usermod -aG sudo $USERNAME; \
    echo "$USERNAME:$USERNAME" | chpasswd; \
    echo "%sudo ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers

#
# workaround for an X11 problem: http://blog.tigerteufel.de/?p=476
RUN set -eux; \
    mkdir /tmp/.X11-unix; \
    chmod 1777 /tmp/.X11-unix; \
    chown $USERNAME /tmp/.X11-unix

# base helper scripts
COPY src-base /setup

#
# make directories for neko
RUN set -eux; \
    mkdir -p /etc/neko /var/www /mnt/host/logs \
    chmod 1777 /mnt/host/logs; \
    chown $USERNAME /mnt/host/logs/; \
    chown -R $USERNAME:$USERNAME /home/$USERNAME

#
# copy Neko server
COPY neko/server/bin/neko /usr/bin/neko

#
# Copy client files
COPY neko/client/dist /var/www

#
# copy config files
COPY neko/.docker/base/xorg.conf /etc/neko/xorg.conf
RUN mkdir -p /etc/neko/supervisord && \
    mv /setup/supervisord.conf /etc/neko/supervisord.conf && \
    mv /setup/supervisord-devtool.conf /etc/neko/supervisord/devtool.conf

#
# add helpful symlinks into home dir
# then (hopefully) we mount over it docker -v
RUN set -eux;\
    mkdir -p /mnt/host;\
    mkdir -p /mnt/host/home;\
    mkdir -p /mnt/host/pwd;\
    mkdir -p /mnt/host/devtool;\
    mkdir -p /mnt/persist/home;\
    chown -R $USERNAME:$USERNAME /mnt;\
    #
    rm -rf /home/$USERNAME;\
    ln -s /mnt/persist/home /home/$USERNAME;\
    chown -R $USERNAME:$USERNAME /home/$USERNAME

# Copy 3rd-party licenses
COPY ThirdPartyLicenses.txt /

# IP requirement for removal
RUN rm -f /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstaudioparsers.so
RUN rm -f /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstfaad.so
RUN rm -f /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstvoaacenc.so
RUN rm -f /usr/lib/x86_64-linux-gnu/libavresample* /usr/lib/x86_64-linux-gnu/libavutil* \
    /usr/lib/x86_64-linux-gnu/libavcodec* /usr/lib/x86_64-linux-gnu/libavformat* \
    /usr/lib/x86_64-linux-gnu/libavfilter*


WORKDIR /home/$USERNAME

CMD ["/bin/bash", "/setup/entrypoint-base.sh"]