1、Emqx
#!/bin/bash docker stop emqttd-docker-v2.3.11 docker rm emqttd-docker-v2.3.11 docker run -tid --name emqttd-docker-v2.3.11 -p 1883:1883 -p 8083:8083 -p 8883:8883 -p 8084:8084 -p 18083:18083 -p 6000:6999 emqttd-docker-v2.3.11
2、MySQL
#!/bin/bash docker stop mysql docker rm mysql docker run -p 3306:3306 --name mysql -v $PWD/conf:/etc/mysql/conf.d -v $PWD/logs:/logs -v $PWD/data:/var/lib/mysql -v /etc/localtime:/etc/localtime:ro -e MYSQL_ROOT_PASSWORD=123456 -d mysql:5.7
3、Oracle
#!/bin/bash docker run -d --name oracle -p 8080:8080 -p 1521:1521 -v $PWD/data:/mnt -e TZ=Asia/Shanghai sath89/oracle-12c
4、Redis
#!/bin/bash REDIS_DIR=/srv/redis docker stop redis docker rm redis docker run --detach --publish 6379:6379 --name redis --volume ${REDIS_DIR}/data:/data redis:latest redis-server --appendonly yes --notify-keyspace-events Ex --protected-mode no
5、Python
# FROM指令指定了基础镜像是python:3.6-alpine,这个基础镜像包含了Alpine Linux操作系统和Python 3.6 FROM python:3.6-alpine # WORKDIR指令将工作目录切换为/app WORKDIR /app # ADD指令将当前目录下的所有内容(app.py、requirements.txt)复制到镜像的 /app 目录下 ADD . /app # RUN指令运行pip命令安装依赖 RUN pip install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt # EXPOSE指令暴露允许被外界访问的8083端口 EXPOSE 8083 # ENV指令设置环境变量NAME ENV NAME World # CMD指令设置容器内进程为:python app.py,即:这个 Python 应用的启动命令 CMD ["python","app.py"]
6、Nginx
FROM nginx:1.17.1 MAINTAINER hejianlai <hejianlai@163.cn> ENV TZ=Asia/Hong_Kong RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone WORKDIR /usr/share/nginx/page-management COPY nginx/default.conf /etc/nginx/conf.d/default.conf COPY static /usr/share/nginx/page-management/ COPY dist /usr/share/nginx/page-management/ RUN chmod 755 -R /usr/share/nginx/page-management/ EXPOSE 80 CMD ["nginx", "-g", "daemon off;"]