Ubuntu 16.04 Dockerfile Install MySQL

Source: Internet
Author: User

The default MARIADB package is not in the Ubuntu repository. To install MARIADB, we will first set up the MARIADB warehouse.

Configuring the MARIADB Warehouse

# 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 '

The default MARIADB package is not in the Ubuntu repository. To install MARIADB, we will first set up the MARIADB warehouse.

# apt-get Update
Hit: 1 http://cn.archive.ubuntu.com/ubuntu xenial inrelease
Fetch: 2/HTTP Sfo1.mirrors.digitalocean.com/mariadb/repo/10.0/ubuntu trusty inrelease [3,234 B]
Ignore: 3 http://dl.google.com/ Linux/chrome/deb stable inrelease
gets: 4 Http://sfo1.mirrors.digitalocean.com/mariadb/repo/10.0/ubuntu trusty/ Main AMD64 Packages [5,626 B]
Hit: 5 http://dl.google.com/linux/chrome/deb stable Release
Hit: 6 https:// Apt.dockerproject.org/repo ubuntu-xenial inrelease
gets: 8 http://sfo1.mirrors.digitalocean.com/mariadb/repo/10.0 /ubuntu trusty/main i386 Packages [5,627 B]
Hit: 9 Http://ppa.launchpad.net/ansible/ansible/ubuntu xenial Inrelease
Hit: Http://ppa.launchpad.net/notepadqq-team/notepadqq/ubuntu xenial inrelease
Downloaded 14.5 kB, time 6 seconds (2,272 b/s)
Reading Package List ... Complete the
W:http://sfo1.mirrors.digitalocean.com/mariadb/repo/10.0/ubuntu/dists/trusty/inrelease: Key The 199369e5404bd5fc7d2fe43bcbcb082a1bb943db generated digital signature uses the weak security Digest algorithm (SHA1)

Build Dockerfile

# Docker build.
Sending build context to Docker daemon 7.68 KB
Step 1:fromxxxxxx
---> B3b17be3a5e6
Step 2:maintainerxxxxxxx<xxxxx @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 All
---> Running in c3d3c5af1bd0
Reading Package Lists ...
Building Dependency Tree ...
Reading state information ...
The following extra packages'll 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'll 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, newly installed, 0 to remove and upgraded.
Need to get 11.7 MB of archives.
After this operation, 119 MB of additional disk space would be used.

Removing intermediate container Cbe87abd3e25
Successfully built CA71E9F40ECF

View the generated images

# Docker Images
REPOSITORY TAG IMAGE ID CREATED SIZE
XXXXXXXCA71E9F40ECF seconds ago 620.3 MB

Ubuntu 16.04 Dockerfile Install MySQL

Related Article

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.