-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile.mesos-agent
41 lines (35 loc) · 1.38 KB
/
Dockerfile.mesos-agent
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
FROM mesos-update
MAINTAINER Kevin Klues <[email protected]>
# Calling 'nvidia-docker run' will perform something
# equivalent to the following when it sees this label
# in the image:
# --privileged \
# -v nvidia_driver_<driver_version>:/usr/local/nvidia:ro \
# -v /dev/nvidiactl:/dev/nvidiactl \
# -v /dev/nvidia-uvm:/dev/nvidia-uvm \
# -v /dev/nvidia*:/dev/nvidia*
LABEL com.nvidia.volumes.needed=nvidia_driver
# Set up some paths so we can find the nvidia driver binaries.
ENV PATH=/usr/local/nvidia/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
# Uninstall the NVML stub library in favor of the real one we mount in.
RUN rm -rf /opt/nvidia-gdk && \
rm -rf /etc/ld.so.conf.d/nvidia-lib64.conf && \
ldconfig
# Create a wrapper script to add the dynamically mounted nvidia libraries to
# ldconfig before running the mesos agent.
RUN echo " \
ldconfig /usr/local/nvidia/lib; \
ldconfig /usr/local/nvidia/lib64; \
mesos-agent \
--master=zk://localhost:2181/mesos \
--launcher=linux \
--image_providers=docker \
--containerizers=mesos \
--isolation=docker/runtime,filesystem/linux,cgroups/devices,gpu/nvidia \
--work_dir=/var/lib/mesos \
--log_dir=/var/log/mesos \
--no-systemd_enable_support" \
> mesos-agent-wrapper
RUN chmod a+x mesos-agent-wrapper
# Run the agent.
ENTRYPOINT ./mesos-agent-wrapper