docker-compose

docker-compose

我与影子孤独终老i 提交于 2019-12-06 14:05:18
docker-compose -f my.yaml version # 查看docker-compose版本信息 docker-compose -f lnmp.yaml images # 列出镜像docker-compose -f lnmp.yaml images -q 列出镜像ID docker-compose up -d nginx # 构建建启动nignx容器 docker-compose exec nginx bash # 登录到nginx容器中docker-compose -f lnmp.yaml exec nginx env 在容器中运行命令 docker-compose down # 删除所有nginx容器,镜像 docker-compose ps # 显示所有容器 docker-compose restart nginx # 重新启动nginx容器 docker-compose run --no-deps --rm php-fpm php -v 在php-fpm中不启动关联容器,并容器执行php -v 执行完成后删除容器 docker-compose build nginx # 构建镜像 。 docker-compose build --no-cache nginx 不带缓存的构建。 docker-compose logs nginx # 查看nginx的日志

Docker compose and hostname

半腔热情 提交于 2019-12-06 13:43:33
I have a compose file with 2 services (containers) named "web" and "db". { "version": "2", "services": { "web": { "image": "nodejs:latest", "ports": ["80"] }, "db": { "image": "mysql:latest", "ports": ["3306"] } } } I am able to access db container from web container by using "db" as ip for my database. What advantage do i have by using "hostname" in the compose file as shown below? { "version": "2", "services": { "web": { "image": "nodejs:latest", "hostname": "web", "ports": ["80"] }, "db": { "image": "mysql:latest", "hostname": "db", "ports": ["3306"] } } } Jacek Lawniczak The feature of

Docker-compose recommended way to use data containers

会有一股神秘感。 提交于 2019-12-06 13:37:38
In my application I have an nginx container that I want to use to serve static webapp files. These webapp files exist in a separate container called "webapp". What's the recommended way of mounting the webapp container into the nginx container? My current approach looks like this: version: '2' services: nginx: volumes_from: - webapp webapp: image: someimageurl And in the Dockerfile for webapp, I expose a volume at the same path that the nginx container is serving. This works great, but the problem is that in docker-compose v3, "volumes_from" is being removed and replaced with named volumes. So

How to pass Chef data bag secret to a docker container?

眉间皱痕 提交于 2019-12-06 13:18:50
问题 I have already created a databag item which is existing on the chef server. Now, I am trying to pass on that databag item secret value to a docker container. I am creating the data bag as follows: knife data bag create bag_secrets bag_masterkey --secret-file C:\path\data_bag_secret I am retrieving value of that databag item in Chef recipe as follows: secret = Chef::EncryptedDataBagItem.load_secret("#{node['secret']}") masterkey = Chef::EncryptedDataBagItem.load("databag_secrets", "databag

docker-compose部署ELK(亲测)

本小妞迷上赌 提交于 2019-12-06 13:08:51
具体的配置可以参考上面一篇: docker部署ELK 以下是做了一些修改的地方: kibana.yml [root@topcheer config]# cat kibana.yml server.host: "0.0.0.0" elasticsearch.url: http://elasticsearch01:9200 xpack: apm.ui.enabled: false graph.enabled: false ml.enabled: false monitoring.enabled: false reporting.enabled: false security.enabled: false grokdebugger.enabled: false searchprofiler.enabled: false [root@topcheer config]# logstash的conf [root@topcheer pipeline]# cat logstash-test.conf input { file { path => ["/usr/share/logstash/pipeline/logs/test.log"] start_position => "beginning" } } output { elasticsearch { hosts => [

zz胖的博客

那年仲夏 提交于 2019-12-06 13:06:19
<Excerpt in index | 首页摘要> docker命令总结 <The rest of contents | 余下全文> docker命令总结 查看镜像 12$ docker iamges $ docker image ls 获取镜像 1$ docker pull [镜像名称] 删除镜像 123$ docker rmi [镜像名称/id]$ dock...... <Excerpt in index | 首页摘要> docker-compose 模板文档 <The rest of contents | 余下全文> docker-compose 模板文档 模板文档是使用 Compose 的核心,涉及到的命令关键字也比较多。但大家不用担心,这里面大部分命令跟 docker run 相关参数的含义都是类似的。 默认的模板文档名称为 ...... docker-compose 命令 <Excerpt in index | 首页摘要> docker-compose 命令 <The rest of contents | 余下全文> docker-compose 命令 命令对象与格式 对于 Compose 来说,大部分命令的对象既可以是项目本身,也可以指定为项目中的服务或者容器。如果没有特别的说明,命令对象将是项目,这意味着项目中所有的服务都会受到命...... Posted by

Running out of inodes on a docker volume

a 夏天 提交于 2019-12-06 12:44:23
I have the following docker-compos.yml file: web: build: . ports: - "4200:4200" - "35729:35729" volumes: - ..:/code - ../home:/home/dev which maps the 2 volumes above. When I login into my VM and run df -i i see Filesystem Inodes IUsed IFree IUse% Mounted on none 1218224 509534 708690 42% / tmpfs 256337 18 256319 1% /dev shm 256337 1 256336 1% /dev/shm tmpfs 256337 11 256326 1% /sys/fs/cgroup none 1000 0 1000 0% /code none 1000 0 1000 0% /home/dev /dev/sda1 1218224 509534 708690 42% /etc/resolv.conf /dev/sda1 1218224 509534 708690 42% /etc/hostname /dev/sda1 1218224 509534 708690 42% /etc

安装docker-compose

China☆狼群 提交于 2019-12-06 12:20:25
#安装最新版本docker-composesudo curl -L "https://github.com/docker/compose/releases/download/1.23.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose 打开权限 sudo chmod +x /usr/local/bin/docker-compose 查看是否安装成功 docker-compose version 来源: https://www.cnblogs.com/djq-jone/p/11983160.html

Docker Compose build context from git repository with Dockerfile inside folder

核能气质少年 提交于 2019-12-06 11:57:00
I would like to build a new image in my docker compose project using a git repository as I need to change some ARG vars. My concern is that the Dockerfile is inside a folder of the git repository. How can be specified a folder as build context using a git repository? Repository: https://github.com/wodby/drupal-php/blob/master/7/Dockerfile version: "2" services: php: build: context: https://github.com/wodby/drupal-php.git dockerfile: 7/Dockerfile args: - BASE_IMAGE_TAG=7.1 - WODBY_USER_ID=117 - WODBY_GROUP_ID=111 volumes: - ./:/var/www/html I've tried the dockerfile property: "FOLDER/" +

docker-compose: command not found on jenkins

瘦欲@ 提交于 2019-12-06 11:52:49
问题 I have a docker compose file version: "3" services: mysql: image: mysql:latest container_name: locations-service-mysql environment: MYSQL_ROOT_PASSWORD: root MYSQL_USERNAME: root MYSQL_DATABASE: 'locations_schema' restart: always volumes: - mysql_data:/var/lib/mysql:rw phpmyadmin: image: phpmyadmin/phpmyadmin:latest ports: - 8181:80 environment: MYSQL_USERNAME: root MYSQL_ROOT_PASSWORD: root PMA_HOST: mysql depends_on: - mysql links: - mysql:mysql dropwizard: build: context : ../locations