[root@master mysql]# ll
total 72
-rw-r–r-- 1 root root 381 Apr 7 11:21 Dockerfile
-rw-r–r-- 1 root root 169 Apr 7 11:20 ftp.repo
-rw-r–r-- 1 root root 59239 Dec 30 12:09 gpmall.sql
-rw-r–r-- 1 root root 341 Apr 7 17:12 init.sh
[root@master mysql]# cat Dockerfile
FROM 192.168.200.4/library/centos:centos7.5.1804
MAINTAINER Chinaskill
RUN rm -rvf /etc/yum.repos.d/*
ADD ftp.repo /etc/yum.repos.d/
ADD gpmall.sql /root/
RUN yum install -y mariadb-server
RUN sed -i “13cport = 8066” /etc/my.cnf.d/server.cnf
ADD init.sh /root/init.sh
RUN chmod +x /root/init.sh
RUN /root/init.sh
ENV LC_ALL en_US.UTF-8
EXPOSE 3306
EXPOSE 8066
CMD [“mysqld_safe”]
[root@master mysql]# cat ftp.repo
[k8s]
name=k8s
baseurl=ftp://192.168.200.4/ChinaskillMall/gpmall-repo
gpgcheck=0
enabled=1
[centos]
name=centos
baseurl=ftp://192.168.100.10/centos
gpgcheck=0
enabled=1
========================================================================
[root@master redis]# ls
Dockerfile ftp.repo
[root@master redis]# cat Dockerfile
FROM 192.168.200.4/library/centos:centos7.5.1804
MAINTAINER Chinaskill
RUN rm -rvf /etc/yum.repos.d/*
COPY ftp.repo /etc/yum.repos.d/local.repo
RUN yum clean all
RUN yum list
RUN yum -y install redis
RUN sed -i -e ‘s@bind 127.0.0.1@bind 0.0.0.0@g’ /etc/redis.conf
RUN sed -i -e ‘s@protected-mode yes@protected-mode no@g’ /etc/redis.conf
RUN sed -i -e ‘s@daemonize yes@daemonize no@g’ /etc/redis.conf
EXPOSE 6379
ENTRYPOINT redis-server /etc/redis.conf
CMD [“redis-server”]
============================================================================
[root@master zookeeper]# ls
Dockerfile ftp.repo zookeeper-3.4.14.tar.gz
[root@master zookeeper]# cat Dockerfile
FROM 192.168.200.4/library/centos:centos7.5.1804
MAINTAINER Chinaskill
RUN rm -rvf /etc/yum.repos.d/*
COPY ftp.repo /etc/yum.repos.d/local.repo
RUN yum -y install java-1.8.0
ADD zookeeper-3.4.14.tar.gz /usr/local
…
===============================================================================
[root@master ~]# cd docker-compose/
[root@master docker-compose]# cat docker-compose.yaml
version: ‘2’
services:
zk1.mall:
image: chinaskillmall-zookeeper:v1.1
restart: always
expose:
-
2181
-
2888
-
3888
volumes:
-
./zookeeper1/conf:/usr/local/zookeeper-3.4.14/conf
-
./zookeeper1/data:/data
zk2.mall:
image: chinaskillmall-zookeeper:v1.1
restart: always
expose:
-
2181
-
2888
-
3888
volumes:
-
./zookeeper2/conf:/usr/local/zookeeper-3.4.14/conf
-
./zookeeper2/data:/data
常用的JavaScript设计模式
-
单体模式
-
工厂模式
-
例模式
函数
-
函数的定义
-
局部变量和全局变量
-
返回值
-
匿名函数
-
自运行函数
-
闭包