docker_practice/cases/os/debian.md

176 lines
8.3 KiB
Go
Raw Permalink Normal View History

2017-05-24 11:22:23 +08:00
## Debian/Ubuntu
Debian Ubuntu Debian Docker Hub
### Debian
![Debian ](_images/debian-logo.png)
Debian GPL Debian Debian ProjectDebian 3000 Software in the Public Interest Debian Unix Debian 25,000 12
Debian Linux Debian GNU/Linux GNU Hurd Debian GNU/Hurd FreeBSD Debian GNU/kFreeBSD NetBSD Debian GNU/NetBSD Debian OpenSolaris Nexenta OS Debian Linux Debian GNU/Linux
Linux UbuntuKnoppix Linspire Xandros Debian GNU/Linux
2017-11-22 11:13:23 +08:00
#### 使 Debian
2017-05-24 11:22:23 +08:00
使 docker search Docker Hub Debian
2017-11-22 11:13:23 +08:00
```bash
2017-05-24 11:22:23 +08:00
$ docker search debian
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
debian Debian is... 1565 [OK]
neurodebian NeuroDebian... 26 [OK]
armbuild/debian port of debian 8 [OK]
...
```
debian neurodebian
使 docker run Debian
2017-11-22 11:13:23 +08:00
```bash
2017-05-24 11:22:23 +08:00
$ docker run -it debian bash
root@668e178d8d69:/# cat /etc/issue
Debian GNU/Linux 8
```
Debian
### Ubuntu
![Ubuntu ](_images/ubuntu-logo.jpg)
Ubuntu GNU/LinuxubuntuUbuntu Ubuntu Debian GNOME/Unity Debian 6 2 Long Term SupportLTS 3
#### 使 Ubuntu
2018-04-08 21:00:11 +08:00
Ubuntu 使 `--filter=stars=10` 10
2017-05-24 11:22:23 +08:00
2017-11-22 11:13:23 +08:00
```bash
2018-04-08 21:00:11 +08:00
$ docker search --filter=stars=10 ubuntu
2017-05-24 11:22:23 +08:00
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
ubuntu Official Ubuntu base image 840 [OK]
dockerfile/ubuntu Trusted automated Ubuntu (http://www.ubunt... 30 [OK]
crashsystems/gitlab-docker A trusted, regularly updated build of GitL... 20 [OK]
sylvainlasnier/memcached This is a Memcached 1.4.14 docker images b... 16 [OK]
ubuntu-upstart Upstart is an event-based replacement for ... 16 [OK]
mbentley/ubuntu-django-uwsgi-nginx 16 [OK]
clue/ttrss The Tiny Tiny RSS feed reader allows you t... 14 [OK]
dockerfile/ubuntu-desktop Trusted automated Ubuntu Desktop (LXDE) (h... 14 [OK]
tutum/ubuntu Ubuntu image with SSH access. For the root... 12 [OK]
```
使
2018-12-19 17:24:52 +08:00
ubuntu 18.04 使
2017-05-24 11:22:23 +08:00
使 `-ti` bash ubuntu
2017-11-22 11:13:23 +08:00
```bash
2018-12-19 17:24:52 +08:00
$ docker run -ti ubuntu:18.04 /bin/bash
root@7d93de07bf76:/# cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04.1 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.1 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
2017-05-24 11:22:23 +08:00
```
使 `apt-get` `E: Unable to locate package`
2017-11-22 11:13:23 +08:00
```bash
2017-05-24 11:22:23 +08:00
root@7d93de07bf76:/# apt-get install curl
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package curl
```
`apt-get` Docker apt `apt-get update` apt-get
2017-11-22 11:13:23 +08:00
```bash
2017-05-24 11:22:23 +08:00
root@7d93de07bf76:/# apt-get update
Ign http://archive.ubuntu.com trusty InRelease
Ign http://archive.ubuntu.com trusty-updates InRelease
Ign http://archive.ubuntu.com trusty-security InRelease
Ign http://archive.ubuntu.com trusty-proposed InRelease
Get:1 http://archive.ubuntu.com trusty Release.gpg [933 B]
...
```
curl
2017-11-22 11:13:23 +08:00
```bash
2017-05-24 11:22:23 +08:00
root@7d93de07bf76:/# apt-get install curl
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
ca-certificates krb5-locales libasn1-8-heimdal libcurl3 libgssapi-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
...
root@7d93de07bf76:/# curl
curl: try 'curl --help' or 'curl --manual' for more information
```
apache
2017-11-22 11:13:23 +08:00
```bash
2017-05-24 11:22:23 +08:00
root@7d93de07bf76:/# apt-get install -y apache2
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
apache2-bin apache2-data libapr1 libaprutil1 libaprutil1-dbd-sqlite3
libaprutil1-ldap libxml2 sgml-base ssl-cert xml-core
...
```
apache 使 curl 访
2017-11-22 11:13:23 +08:00
```bash
2017-05-24 11:22:23 +08:00
root@7d93de07bf76:/# service apache2 start
* Starting web server apache2 AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message
*
root@7d93de07bf76:/# 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">
<html xmlns="http://www.w3.org/1999/xhtml">
<!--
Modified from the Debian original for Ubuntu
Last updated: 2014-03-19
See: https://launchpad.net/bugs/1288690
-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Apache2 Ubuntu Default Page: It works</title>
<style type="text/css" media="screen">
...
```
使 `-p` 访
###
2017-12-01 17:32:53 +08:00
* `Debian` https://www.debian.org/
* `Neuro Debian` http://neuro.debian.net/
* `Debian` https://github.com/Debian
* `Debian` https://hub.docker.com/_/debian/
* `Debian` https://github.com/tianon/docker-brew-debian/
* `Ubuntu` http://www.ubuntu.org.cn/global
* `Ubuntu` https://github.com/ubuntu
* `Ubuntu` https://hub.docker.com/_/ubuntu/
* `Ubuntu` https://github.com/tianon/docker-brew-ubuntu-core