欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

debian mysql Dockerfile代码实例

程序员文章站 2022-03-23 19:44:58
debian mysql dockerfile代码实例 # pull base image from debian:9 # modify apt source.list run ech...

debian mysql dockerfile代码实例

# pull base image
from debian:9

# modify apt source.list
run echo 'deb https://mirrors.aliyun.com/debian/ stretch main non-free contrib' >> /etc/apt/sources.list
run echo 'deb-src https://mirrors.aliyun.com/debian/ stretch main non-free contrib' >> /etc/apt/sources.list
run echo 'deb https://mirrors.aliyun.com/debian-security stretch/updates main' >> /etc/apt/sources.list
run echo 'deb-src https://mirrors.aliyun.com/debian-security stretch/updates main' >> /etc/apt/sources.list
run echo 'deb https://mirrors.aliyun.com/debian/ stretch-updates main non-free contrib' >> /etc/apt/sources.list
run echo 'deb-src https://mirrors.aliyun.com/debian/ stretch-updates main non-free contrib' >> /etc/apt/sources.list
run echo 'deb https://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib' >> /etc/apt/sources.list
run echo 'deb-src https://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib' >> /etc/apt/sources.list


# update source
run apt-get clean && apt-get update

# install lrzsz
run apt-get -y install lrzsz vim ssh mysql-server net-tools inetutils-ping


# start service
entrypoint service mysql start

构建

docker build -t debian:mysql .