默认上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的更多相关文章

  1. Ubuntu 16.04 上安装 MySQL 5.7 教程

    介绍 MySQL 是一种开源数据库管理系统,通常作为流行的LAMP(Linux,Apache,MySQL,PHP / Python / Perl)堆栈的一部分安装.它使用关系数据库和SQL(结构化查询 ...

  2. Ubuntu 16.04 - python3 安装mysql驱动

    阿西吧,今天碰到一件特别蛋疼的事,给Ubuntu安装Python的MySQL驱动,驱动显示安装成功了 pip install mysql-connector 但是 在程序中导入,老是报错. Trace ...

  3. Ubuntu 16.04下安装MySQL及远程连接

    最近因为要研究一个关于MySQL的漏洞,所以需要MySQL的环境,就用了近一个小时的时间搭建了一个,期间出了点问题,故记录于此. 1.首先是安装,在命令窗口中输入下面三条命令即可. sudo apt- ...

  4. 阿里云服务器Ubuntu 16.04 3安装mysql

    .更新系统 apt-get update [注意:要在root用户下] .安装mysql-server apt-get install mysql-serverapt-get install mysq ...

  5. Ubuntu 16.04 LTS 安装 Nginx/PHP 5.6/MySQL 5.7 (LNMP) 与Laravel

    Ubuntu 16.04 LTS 安装 Nginx/PHP 5.6/MySQL 5.7 (LNMP) 与Laravel 1.MySQL安装[安装 MariaDB]MariaDB是MySQL的一个分支首 ...

  6. 在Ubuntu 18.04 下安装mysql,没有初始密码,重设root密码

    在Ubuntu 18.04 下安装mysql 不知道是由于mysql更新为新版还是.Ubuntu18.04中的特性,安装过程中没有设置密码的环节,在网络上找了半天,总算解决了!特此记录下来,以便以后查 ...

  7. Ubuntu 16.04 LTS安装 TeamViewer

    Ubuntu 16.04 LTS安装 TeamViewer     64位Ubuntu 16.04系统需要添加32位架构支持,命令如下. sudo dpkg --add-architecture i3 ...

  8. Linux Ubuntu 16.04 初次安装使用总结zzz

    装了两天的ubuntu系统终于算是勉强能用了,来来回回装了有三四次,期间出了各种各样的毛病.但是还是被我的Google大法给治好了.为了装这个系统,算是耗了两天的时间,啥事情都没干,干耗在这上面了.所 ...

  9. Ubuntu 16.04 RabbitMq 安装与运行(安装篇)

    Ubuntu 16.04 RabbitMq 安装与运行(安装篇) 2018年08月15日 15:05:24 我跟吴彦祖四六开 阅读数:1966   前言 目前公司用阿里云 + redis 的方式实现的 ...

随机推荐

  1. linux 批量删除进程

    2016年11月18日 13:11:10 星期五 ps -ef | grep pname | awk '{print $2}' | xargs kill 解释: 杀掉所有包含 'pname' 的进程

  2. 自定义TextView 调用ttf格式字体

    自定义TextView 调用ttf格式字体 1.<strong>将ttf格式文件存放在assets/fonts/下</strong> 注:PC系统字体存放在C:\Windows ...

  3. C++ Bitstream类

    从raknet上剥下来的 比较适用于前后端通讯,可以对BitStream进行二次封装,方便使用. BitStream.h: #ifndef __BITSTREAM_H #define __BITSTR ...

  4. AE+C# 版本更新问题 命名空间“ESRI”中不存在类型或命名空间名称“Arcgis”(是缺少程序集引用吗?)

    解决办法: 1 引用 将下图中解决方案->引用中带感叹号的已用移除,然后添加新的.因为不同版本用的.dll不同,因此需要删除,然后重新加载. 如果是系统库文件, 直接在.NET下头添加,如果是自 ...

  5. ubuntu 报错: The system is running in low-graphics mode

    出错原因不知为何,apt-get install --reinstall unity-greeter 不起作用. 试了一下,这样居然有效: cd /etc/X11 sudo cp xorg.conf. ...

  6. Linux C编程学习6---字符串处理、数据转换

    1.字符串 应用程序按其功能可分为数值计算.非数值计算以及输入输出操作等.非数值计算程序占相当大的比例,其核心就是字符串处理1.1.字符测试 1.1.1.测试字符是否为英文字母 int isalpha ...

  7. 【leetcode】Length of Last Word

    题目简述 Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return ...

  8. 序言<EntityFramework6.0>

    Entity Framework是微软战略性的数据访问技术,不同与早期访问技术,Entity Framework并不耦合在Visual Studio中,它提供了一个全面的, 基于模型的生态系统,使您能 ...

  9. 初识Python-Python介绍

    Python介绍 在了解了计算机以及操作系统的发展历程之后,又接触到了一门新的语音——Python,迈出了学习编程的第一步. 一.Python简介: Python(英国发音:/ˈpaɪθən/ 美国发 ...

  10. F#之旅5 - 小实践之下载网页(爬虫基础库)

    参考文章:https://swlaschin.gitbooks.io/fsharpforfunandprofit/content/posts/fvsc-download.html 参考的文章教了我们如 ...