Install in ubuntu
Sudo apt-get install docker. io
# Start docker
Service docker. io status
Service docker. io start
Error loading docker apparmor profile: exec: "/sbin/apparmor_parser": stat/sbin/apparmor_parser: no such file or directory ()
Apt-get install apparmor # install apparmor
Docker-d # no error happens
Service docker. io start # started successfully
Docker info # View a bunch of information
Sudo docker run ubuntu/bin/echo hello world
# Start pull ubuntu image directly, and pull will output hello world
Docker run-I-t ubuntu/bin/bash # Interactive cli
Install some tools after entering the interactive mode. Some scripts are in the current container.
Apt-get update
Apt-get install nodejs
# Add a nodejs shell
Docker ps-a # get the container id
Docker export 9e840e23be03> image. tgz # output image
Cat image. tgz | sudo docker import-ubuntu_with_nodejs # import an image
Docker images # list all the images
Docker run-I-t ubuntu_with_nodejs/bin/bash # All functions before entering the custom image are available, and the commands are also in place