docker 业 ,精于勤 荒于嬉.
- docker docker-php
-
发表日期:2021-07-26 23:29:19 | 来源: | 分类:docker
-
示例1
FROM centos:latest MAINTAINER anyehk@163.com RUN yum install -y gcc gcc-c++ glibc make openssl-devel RUN yum install -y nginx RUN yum install -y php php-devel php-gd php-json php-mbstring php-mysqlnd php-odbc php-opcache php-pdo php-pear php-pecl-zip php-soap php-xml RUN pecl install redis && echo 'extension=redis' >> /etc/php.d/20-redis.ini RUN mkdir /run/php-fpm/ RUN echo '<?php phpinfo();?>' >> /usr/share/nginx/html/index.php ADD nginx.conf /etc/nginx/nginx.conf # 安装MSSQL驱动 # https://docs.microsoft.com/zh-cn/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-ver15 RUN curl https://packages.microsoft.com/config/rhel/8/prod.repo > /etc/yum.repos.d/mssql-release.repo \ && ACCEPT_EULA=Y yum install -y msodbcsql17 \ && ACCEPT_EULA=Y yum install -y mssql-tools \ && ACCEPT_EULA=Y yum install -y unixODBC-devel \ && echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc \ && source ~/.bashrc # 安装php-sqlserver扩展 http://pecl.php.net/package-search.php?pkg_name=sqlsrv RUN pecl install http://pecl.php.net/get/sqlsrv-5.6.0.tgz && echo 'extension=sqlsrv' >> /etc/php.d/20-sqlsrv.ini RUN pecl install http://pecl.php.net/get/pdo_sqlsrv-5.6.0.tgz && echo 'extension=pdo_sqlsrv' >> /etc/php.d/30-pdo_sqlsrv.ini RUN yum install -y epel-release RUN yum install -y supervisor ADD supervisord.conf /etc/supervisord.conf ADD supervisord.d /etc/supervisord.d/ EXPOSE 80 443 9001 ADD entrypoint.sh /etc/entrypoint.sh RUN chmod 755 /etc/entrypoint.sh ENTRYPOINT ["/etc/entrypoint.sh"] # ENTRYPOINT ["supervisord","-c","/etc/supervisord.conf"]
- docker docker-compose
-
发表日期:2021-07-26 23:28:47 | 来源: | 分类:docker
-
示例1
nginx: build: ./nginx volumes: - /home/eniac/Desktop/docker-test/nginx/html:/usr/local/nginx/html - /home/eniac/Desktop/docker-test/nginx/conf:/usr/local/nginx/conf - /home/eniac/Desktop/docker-test/nginx/logs:/usr/local/nginx/logs ports: - "8082:80" links: - php php: build: ./php volumes: - /home/eniac/Desktop/docker-test/nginx/html:/var/www/html - /home/eniac/Desktop/docker-test/php:/usr/local/etc/php ports: - "9000:9000"
- docker docker-mysql
-
发表日期:2021-07-26 23:28:27 | 来源: | 分类:docker
-
示例1
mysql #docker run -it --entrypoint /bin/bash --rm mysql:5.6 (创建并进入容器里,方便查看容器里面的默认设置,--rm参数表示退出容器会自动删除当前容器) docker run --privileged=true -p 3306:3306 --name mysql \ -v /media/eniac/娱乐/docker/mysql/logs:/var/log/mysql \ -v /media/eniac/娱乐/docker/mysql/data:/var/lib/mysql \ -e MYSQL_ROOT_PASSWORD=123456 \ -d mysql:5.6 docker container ls docker exec -it mysql bash 挂载了配置就不能正常挂载数据了。。 -v /media/eniac/娱乐/docker/mysql/conf:/etc/mysql/mysql.conf.d \