学会写Dockerfile以及操作实例

2021-01-14 10:18:32 浏览数 (1)

tensorflow 与cuda对应版本

ubuntu 1604.py3 Dockerfile

代码语言:javascript复制
FROM scratch
ADD ubuntu-xenial-core-cloudimg-amd64-root.tar.gz /

# a few minor docker-specific tweaks
# see https://github.com/docker/docker/blob/9a9fc01af8fb5d98b8eec0740716226fadb3735c/contrib/mkimage/debootstrap
RUN set -xe 
	
# https://github.com/docker/docker/blob/9a9fc01af8fb5d98b8eec0740716226fadb3735c/contrib/mkimage/debootstrap#L40-L48
	&& echo '#!/bin/sh' > /usr/sbin/policy-rc.d 
	&& echo 'exit 101' >> /usr/sbin/policy-rc.d 
	&& chmod  x /usr/sbin/policy-rc.d 
	
# https://github.com/docker/docker/blob/9a9fc01af8fb5d98b8eec0740716226fadb3735c/contrib/mkimage/debootstrap#L54-L56
	&& dpkg-divert --local --rename --add /sbin/initctl 
	&& cp -a /usr/sbin/policy-rc.d /sbin/initctl 
	&& sed -i 's/^exit.*/exit 0/' /sbin/initctl 
	
# https://gi

0 人点赞