docker-compose


use nvidia-docker-compose launch a container, but exited soon


My docker-compose.yml file :
version: '2'
services:
zl:
image: zl/caffe-torch-gpu:12.27
ports:
- "8801:8888"
- "6001:6008"
devices:
- /dev/nvidia0
volumes:
- ~/dl-data:/root/dl-data
After nvidia-docker-compose up -d the container launched, but exited soon.
But when I launch a container by nvidia-docker way, it worked well.
nvidia-docker run -itd -p 6008:6006 -p 8808:8888 -v `pwd`:/root/dl-data --name zl_test
You don't have to use nvidia-docker-compose.
By configuring the nvdia-docker plugin correctly you can just use docker-compose!
Via the nvidia docker git repo:
(can confirm it works for me)
Step 1:
Figure out nvidia driver version (it matters).
run:
nvidia-smi
output:
+---------------------------------------------------------------+
NVIDIA-SMI 367.57 Driver Version: 367.57
|-------------------------------+--------+----------------------+
Step 2:
create a docker volume that uses the nvidia-docker plugin must be done outside of compose as compose will mangle the volume name if it creates it.
docker volume create --name=nvidia_driver_367.57 -d nvidia-docker
Step 3
in the docker-compose.yml file:
version: '2'
volumes:
nvidia_driver_367.57: # same name as one created above
external: true #this will use the volume we created above
services:
cuda:
command: nvidia-smi
devices: #this is required
- /dev/nvidiactl
- /dev/nvidia-uvm
- /dev/nvidia0 #in general: /dev/nvidia# where # depends on which gpu card is wanted to be used
image: nvidia/cuda
volumes:
- nvidia_driver_367.57:/usr/local/nvidia/:ro

Related Links

Docker compose to always deploy using latest image
JHipster - Doubts in the development using Microservices Architecture
Gogs + Drone getsockopt: connection refused
Concourse result keeps loading
Docker-compose: AttributeError: 'module' object has no attribute 'ssl'
scaling a service with docker compose
Docker Compose apparently ignores COMPOSE_FILE
Where does Docker install gems on a mac
What is the difference between docker-machine and docker-compose?
Docker Compose port issue. Cannot launch docker project on localhost
Name an image built from running a docker-compose file
Race conditions after changing names in docker-compose.yml
Docker compose - image not found
How to work out the hostname that compose gives containers?
docker-compose restart container if service is dead
Swarm scheduling not working as expected using filters in compose file

Categories

HOME
c#
asterisk
classification
javafx
indexing
leaflet
ldap
magento-1.9.2.1
nltk
hiveql
datetimepicker
google-docs-api
msbi
css-selectors
revit-api
subprocess
segmentation-fault
oms
jpql
resharper
tracking
yui
dev-c++
ckeditor4.x
grunt-contrib-uglify
hierarchy
arp
voyager
wit-ai
dom4j
outlook-2010
mediastream
file-conversion
office-interop
susy
file-descriptor
autodesk-data-management
php-mongodb
qt-quick
api-key
logan-square
ocpjp
spring-ide
spring-data-commons
react.rb
spring-cloud-bus
px4
android-vectordrawable
grib
trusted-computing
init
bytearray
gdi
django-celery
boost-bind
audiorecord
boost-propertytree
nonblocking
encode
controlpanel
gnu-sort
event-tracking
personality-insights
exchange-server-2007
log4cxx
openhab
autoscaling
tooltwist
playn
jeet-grid
pymol
fiware-health
pysvn
mind-manager
novell
agent-based-modeling
switchpreference
mvcgrid
rda
winrun4j
complete
dylan
sygic
ie-developer-tools
zend-db-table
playing-cards
listpicker
database-restore
urlfetch
ncml
screensharing
junit-rule
netzke
php-gettext
scsf
automapper-2
mscorlib
rjs
lightopenid
object-tag
hwnd
lwp
response-time
excellibrary
hp-trim

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App