Installing Ubuntu in Docker

Source: Internet
Author: User
Tags memcached ssh access tiny tiny rss fully qualified domain name docker run

Use the official Ubuntu image

There are many images associated with Ubuntu, where -s 10 parameters are used to search only those images that have been collected more than 10 times.

$ docker Search-s 10ubuntuname DESCRIPTION STARS official Autom Atedubuntu official Ubuntu base image840[Ok]dockerfile/ubuntu Trusted automated Ubuntu (Http://www.ubunt ...   [Ok]crashsystems/gitlab-docker A Trusted, regularly updated build of gitl ...   [Ok]sylvainlasnier/memcached This is a memcached 1.4.14 docker images B ... [Ok]ubuntu-upstart Upstart is an event-based replacement for... 16[Ok]mbentley/ubuntu-django-uwsgi-nginx [ok]ansible/ubuntu14.04-                           Ansible Ubuntu 14.04 LTS with ansible [Ok]clue/ttrss   The Tiny Tiny RSS feed reader allows you t ...   [ok]dockerfile/ubuntu-desktop Trusted automated Ubuntu Desktop (LXDE) (H ... [Ok]tutum/ubuntu ubuntu image with SSH access.   For the root ... [OK]

Note that the--stars parameter is not already supported in the Docker 1.12 release, so you can use the-F stars=n parameter.

Based on the results of the search, readers can choose to download the image and use it by themselves.

The following is an example of Ubuntu 14.04, which shows how to use this image to install some common software.

Start the -ti container with the parameters first, log in to bash, and view the release number of Ubuntu.

Basic Ubuntu Information

Ubuntu is a popular Linux distribution, and its own version of the software is often newer.

The warehouse is located in https://hub.docker.com/_/ubuntu/, which offers Ubuntu images from 12.04 to 16.10 versions of each.

How to use

The default is to start a minimized Ubuntu environment.

$ docker Run--name some-ubuntu-i-t Ubuntu[email protected]:/#

When trying to apt-get install a software directly, you will be prompted E: Unable to locate package .

1 [email protected]:/# apt-get Install Curl2Reading Package lists ... do3Building dependency tree4Reading state information ... do5 e:unable to locate package curl

This is not a command that is not supported by the system apt-get . The Docker image was created to simplify the removal of apt warehouse information, so you need to execute the apt-get update command to update the warehouse information first. After you update the information, you can successfully install the software via the Apt-get command.

[email protected]:/# apt-get updateign http://archive.ubuntu.com trusty inreleaseIgn http://  archive.ubuntu.com trusty-updates inreleaseIgn http://archive.ubuntu.com Trusty-security inreleaseIgn http://archive.ubuntu.com trusty-proposed inreleaseget:1 http: // archive.ubuntu.com trusty RELEASE.GPG [933 B]...

First, install the Curl tool.

 [email protected]:/# apt-get install Curlreading Package lists ... Donebuilding dependency treereading state information ... Donethe following extra packages would be INSTALLED:CA -certificates krb5-locales libasn1-8-heimdal libcurl3 LIBGSS Api-krb5-2 Libgssapi3 -heimdal libhcrypto4-heimdal libheimbase1-heimdal libheimntlm0 -heimdal libhx509-5-heimdal libidn11 Libk5crypto3 libkeyutils1 libkrb5  -26-heimdal libkrb5-3 libkrb5support0 libldap-2.4-2  libroken18 -heimdal librtmp0 libsasl2-2 libsasl2-modules Libsasl2-modules-db libwind0 -heimdal OpenSSL ... [email protected]: /# curlcurl: try  ' curl--help ' or ' Curl--manual ' Span style= "COLOR: #0000ff" >for  More information 

Next, install the Apache service.

[Email protected]:/# apt-get install-y apache2Reading Package lists ... Donebuilding dependency treereading state information ... Donethe following extra packages would be installed:  apache2-bin apache2-data libapr1 libaprutil1 libaprutil1-dbd-sqlite3  libaprutil1-ldap libxml2 sgml-base ssl-cert xml-core ...

Start the Apache service, and then use Curl to test local access.

 [email protected]:/# Service apache2 Start * Starting Web server Apache2 AH00558:apache2:Could not Reliabl Y determine the server ' s fully qualified domain name, using 172.17.0.2. Set the ' ServerName '  directive globally to suppress this message *[email protected]:/ # Curl 127.0.0.1<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> 

With -p the use of parameters to map the service port externally, you can allow the container external access to the service.

Related Resources
    • DebianWebsite:https://www.debian.org/
    • Neuro DebianWebsite:http://neuro.debian.net/
    • DebianOfficial warehouses:https://github.com/Debian
    • DebianOfficial Image:https://hub.docker.com/_/debian/
    • DebianOfficial Image Warehouse:https://github.com/tianon/docker-brew-debian/
    • UbuntuWebsite:http://www.ubuntu.org.cn/global
    • UbuntuOfficial warehouses:https://github.com/ubuntu
    • UbuntuOfficial Image:https://hub.docker.com/_/ubuntu/
    • UbuntuOfficial Image Warehouse:https://github.com/tianon/docker-brew-ubuntu-core

Installing Ubuntu in Docker

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.