编写一个基础的dockerfile
编写简单的dockerfile
FROM GaohongYu/centos7.5-yum:latest
MAINTAINER GaoHongYu
COPY *.repo /etc/yum.repos.d/
RUN useradd admin && echo 123123 |passwd --stdin admin \
&& yum install -y sudo && sed -i 'N;100a\admin ALL=(ALL) ALL' /etc/sudoers \
&& su admin && sudo yum clean all && sudo yum makecache \
&& sudo yum -y install mariadb
USER admin
EXPOSE 3306
CMD ["tailf","/dev/zero"]
制作docker镜像
docker build -t="centos7.5_mysql:v1" .
以此镜像创建一个docker容器
docker run -p 3306 --privileged=true --name mysql_test -d centos7.5_mysql:v1 /usr/sbin/init
QQ:1061767621
Q群:215481318