星球的眼睛 发表于 2025-3-19 02:37:14

2024技能大赛云计算赛项先电2

二、Java环境预备
=========================================================================
https://img-blog.csdnimg.cn/20210405171702428.png
# 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 jdk-8u77-linux-x64.tar.gz /opt


ADD start.sh /start.sh
RUN chmod +x /start.sh
EXPOSE 8081
EXPOSE 8082
EXPOSE 20880
EXPOSE 20881
EXPOSE 9090
CMD [“bash”,“/start.sh”]
三、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
# 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”]
# cat ftp.repo

name=k8s
baseurl=ftp://192.168.200.4/ChinaskillMall/gpmall-repo
gpgcheck=0
enabled=1

name=centos
baseurl=ftp://192.168.100.10/centos
gpgcheck=0
enabled=1
四、Redis环境
========================================================================
# ls
Dockerfile ftp.repo
# 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”]
五、Zookeeper环境
============================================================================
# ls
Dockerfile ftp.repo zookeeper-3.4.14.tar.gz
# 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

六、Docker-compose
===============================================================================
# cd 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




免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
页: [1]
查看完整版本: 2024技能大赛云计算赛项先电2