Install a virtual machine under the docker command line in ubuntu

Source: Internet
Author: User
Tags docker ps docker run


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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.