標籤:
預設上MariaDB的包並沒有在Ubuntu倉庫中。要安裝MariaDB,我們首先要設定MariaDB倉庫。
配置MariaDB 倉庫
# apt-get install software-properties-common
# apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
# add-apt-repository ‘deb http://sfo1.mirrors.digitalocean.com/mariadb/repo/10.0/ubuntu trusty main‘
預設上MariaDB的包並沒有在Ubuntu倉庫中。要安裝MariaDB,我們首先要設定MariaDB倉庫。
# apt-get update
命中:1 http://cn.archive.ubuntu.com/ubuntu xenial InRelease
擷取:2 http://sfo1.mirrors.digitalocean.com/mariadb/repo/10.0/ubuntu trusty InRelease [3,234 B]
忽略:3 http://dl.google.com/linux/chrome/deb stable InRelease
擷取:4 http://sfo1.mirrors.digitalocean.com/mariadb/repo/10.0/ubuntu trusty/main amd64 Packages [5,626 B]
命中:5 http://dl.google.com/linux/chrome/deb stable Release
命中:6 https://apt.dockerproject.org/repo ubuntu-xenial InRelease
擷取:8 http://sfo1.mirrors.digitalocean.com/mariadb/repo/10.0/ubuntu trusty/main i386 Packages [5,627 B]
命中:9 http://ppa.launchpad.net/ansible/ansible/ubuntu xenial InRelease
命中:10 http://ppa.launchpad.net/notepadqq-team/notepadqq/ubuntu xenial InRelease
已下載 14.5 kB,耗時 6秒 (2,272 B/s)
正在讀取軟體包列表... 完成
W: http://sfo1.mirrors.digitalocean.com/mariadb/repo/10.0/ubuntu/dists/trusty/InRelease: 密鑰 199369E5404BD5FC7D2FE43BCBCB082A1BB943DB 產生的數位簽章使用了弱安全性摘要演算法(SHA1)
Build Dockerfile
# docker build .
Sending build context to Docker daemon 7.68 kB
Step 1 : FROM ××××××
---> b3b17be3a5e6
Step 2 : MAINTAINER ××××××× <×××××@qq.com>
---> Using cache
---> 73d23501f6f0
Step 3 : ENV DATA_DIR /var/lib/mysql
---> Using cache
---> ad11a90574d3
Step 4 : RUN apt-get install -y mariadb-server && apt-get clean all
---> Running in c3d3c5af1bd0
Reading package lists...
Building dependency tree...
Reading state information...
The following extra packages will be installed:
libaio1 libdbd-mysql-perl libdbi-perl libhtml-template-perl
libmariadbclient18 libmysqlclient18 libreadline5 libterm-readkey-perl
mariadb-client-5.5 mariadb-client-core-5.5 mariadb-common mariadb-server-5.5
mariadb-server-core-5.5 mysql-common psmisc
Suggested packages:
libclone-perl libmldbm-perl libnet-daemon-perl libplrpc-perl
libsql-statement-perl libipc-sharedcache-perl mailx mariadb-test tinyca
The following NEW packages will be installed:
libaio1 libdbd-mysql-perl libdbi-perl libhtml-template-perl
libmariadbclient18 libmysqlclient18 libreadline5 libterm-readkey-perl
mariadb-client-5.5 mariadb-client-core-5.5 mariadb-common mariadb-server
mariadb-server-5.5 mariadb-server-core-5.5 mysql-common psmisc
0 upgraded, 16 newly installed, 0 to remove and 88 not upgraded.
Need to get 11.7 MB of archives.
After this operation, 119 MB of additional disk space will be used.
Removing intermediate container cbe87abd3e25
Successfully built ca71e9f40ecf
查看產生的images
# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
××× ×××× ca71e9f40ecf 42 seconds ago 620.3 MB
ubuntu 16.04 Dockerfile 安裝mysql