一、制作符合要求的镜像
$ docker pull ubuntu:16.04
$ docker run -it ubuntu:16.04
$ ls
hadoop-2.7.7.tar.gz jdk-8u241-linux-x64.tar.gz
$ docker exec -it 05272c80eb5b /bin/bash
root@05272c80eb5b:/opt
$ docker cp jdk-8u241-linux-x64.tar.gz 05272c80eb5b:/opt/software
$ docker cp hadoop-2.7.7.tar.gz 05272c80eb5b:/opt/software
root@05272c80eb5b:/opt
root@05272c80eb5b:/opt/software
hadoop-2.7.7.tar.gz jdk-8u241-linux-x64.tar.gz
root@05272c80eb5b:/opt/software
root@05272c80eb5b:/opt/software
root@05272c80eb5b:/opt
root@05272c80eb5b:/opt
root@05272c80eb5b:/opt
root@05272c80eb5b:/opt/software
root@05272c80eb5b:/opt/software
root@05272c80eb5b:/
root@05272c80eb5b:/
root@05272c80eb5b:/
root@05272c80eb5b:/
root@05272c80eb5b:/
root@05272c80eb5b:/
root@05272c80eb5b:/etc/apt
apt.conf.d preferences.d sources.list.d trusted.gpg
auth.conf.d sources.list sources.list.save trusted.gpg.d
root@05272c80eb5b:/etc/apt/sources.list.d
webupd8team-ubuntu-java-xenial.list
root@05272c80eb5b:/etc/apt/sources.list.d
deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main
root@05272c80eb5b:/etc/apt/sources.list.d
root@05272c80eb5b:/etc/apt
root@05272c80eb5b:/etc/apt
root@05272c80eb5b:/etc/apt$ cat sources.list
deb http://mirrors.aliyun.com/ubuntu/ xenial main
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb http://archive.ubuntu.com/ubuntu/ trusty main universe restricted multiverse
test@hadoop101:~/桌面$ docker exec -it 05272c80eb5b /bin/bash
root@05272c80eb5b:/
root@05272c80eb5b:/
root@05272c80eb5b:/
root@05272c80eb5b:~
root@05272c80eb5b:~
root@05272c80eb5b:~/.ssh
total 16
drwx------ 2 root root 4096 Apr 7 10:21 ./
drwx------ 1 root root 4096 Apr 7 10:17 ../
-rw---