阿里云-云小站(无限量代金券发放中)
【腾讯云】云服务器、云数据库、COS、CDN、短信等热卖云产品特惠抢购

Ubuntu 16.04 Dockerfile 安装MariaDB

143次阅读
没有评论

共计 3208 个字符,预计需要花费 9 分钟才能阅读完成。

默认上 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

Linux 系统教程:如何检查 MariaDB 服务端版本  http://www.linuxidc.com/Linux/2015-08/122382.htm

MariaDB Proxy 读写分离的实现 http://www.linuxidc.com/Linux/2014-05/101306.htm

Linux 下编译安装配置 MariaDB 数据库的方法 http://www.linuxidc.com/Linux/2014-11/109049.htm

CentOS 系统使用 yum 安装 MariaDB 数据库 http://www.linuxidc.com/Linux/2014-11/109048.htm

安装 MariaDB 与 MySQL 并存 http://www.linuxidc.com/Linux/2014-11/109047.htm

Ubuntu 上如何将 MySQL 5.5 数据库迁移到 MariaDB 10  http://www.linuxidc.com/Linux/2014-11/109471.htm

[翻译]Ubuntu 14.04 (Trusty) Server 安装 MariaDB  http://www.linuxidc.com/Linux/2014-12/110048htm

MariaDB 的详细介绍 :请点这里
MariaDB 的下载地址 :请点这里

本文永久更新链接地址 :http://www.linuxidc.com/Linux/2016-09/135260.htm

正文完
星哥说事-微信公众号
post-qrcode
 0
星锅
版权声明:本站原创文章,由 星锅 于2022-01-22发表,共计3208字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
阿里云-最新活动爆款每日限量供应
评论(没有评论)
验证码
【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中