docker-compose

How to map the host OS file to the container at the time of container build process

给你一囗甜甜゛ 提交于 2019-12-14 04:05:00
问题 docker-compose.yml: version: '3' services: ezmove: volumes: - /host-dir:/home/container-dir build: context: . args: BRANCH: develop Dockerfile: FROM appcontainers/ubuntu:xenial MAINTAINER user <user> RUN apt-get update -y --no-install-recommends \ && apt-get install -y --no-install-recommends python3.5-minimal python3.5-venv \ && apt-get install -y --no-install-recommends git \ && apt-get install -y --no-install-recommends python-pip \ && pip install --upgrade pip \ && rm -rf /var/lib/apt

How fix mounting issue while using docker-compose.yml on test containers

落花浮王杯 提交于 2019-12-14 04:04:50
问题 I am using test containers to run some tests and using https://www.testcontainers.org/modules/docker_compose/ to spin some containers used for my tests. Similar to generic containers support, it's also possible to run a bespoke set of services specified in a docker-compose.yml file. This is intended to be useful on projects where Docker Compose is already used in dev or other environments to define services that an application may be dependent upon. Here is my code to include docker-compose

Can't access docker url via curl or Postman

浪尽此生 提交于 2019-12-14 03:49:49
问题 I can access my site in the browser with the following path: my-dash.docker.localhost:8000 I am trying to write an API endpoint and can't access the site via Postman or curl. curl my-dash.docker.localhost:8000 curl: (6) Could not resolve host: my-dash.docker.localhost This is my docker-compose.yml: version: "2" services: mariadb: image: wodby/mariadb:10.1-2.1.0 environment: MYSQL_ROOT_PASSWORD: root MYSQL_DATABASE: drupal MYSQL_USER: drupal MYSQL_PASSWORD: drupal volumes: - ./mariadb-init:

Docker Deploy stack extra hosts ignored

孤人 提交于 2019-12-14 03:07:14
问题 docker stack deploy isnt respecting the extra_hosts parameter in my compose file. when i do a simple docker-compose up the entry is created in the /etc/hosts however when i do docker deploy –compose-file docker-compose.yml myapp it ignores extra_hosts, any insights? Below is the docker-compose.xml: version: '3' services: web: image: user-service deploy: labels: - the label build: context: ./ environment: DATABASE_URL: jdbc:postgresql://dbhost:5432/postgres ports: - 9002:9002 extra_hosts: -

Docker那些事儿之编排工具docker-compose

筅森魡賤 提交于 2019-12-14 02:19:46
前面已经讲解过docker的一些基础使用,镜像创建的操作过程,如果大量容器需要同时部署,一个一个容器进行服务器上的部署,估计要疯掉,在使用上我们需要找到更好更便捷的使用方式,今天要讲解的容器编排工具docker-compose就是其中之一 简介 Compose是一个用于定义和运行多容器Docker应用程序的工具。使用Compose,您可以使用YAML文件来配置应用程序的服务。然后,使用单个命令,您可以从配置中创建并启动所有服务。 docker-compose作为容器编排工具,专门用于处理多容器部署问题,当然,目前对于系统运维有更好的处理方式,比如k8s,由于笔者并不是系统运维人员,所以不会涉及这么深入,本文也只是浅显的介绍下docker-compose,记录下自己的使用过程 特征 单个主机上的多个隔离环境 compose使用项目名称将环境彼此隔离。每次我们使用docker-compose创建多个容器时,其会自动帮我们将彼此环境进行隔离,非常有用 在开发主机上,创建单个环境的多个副本,例如当您要为项目的每个功能分支运行稳定副本时 在CI服务器上,为了防止构建相互干扰,可以将项目名称设置为唯一的构建号 在共享主机或开发主机上,以防止可能使用相同服务名称的不同项目相互干扰 这里可以使用 -p 参数来设置此次compose启动的项目名,可以自行安装测试下 仅重新创建已更改的容器

Unable to mount a file with docker-compose

两盒软妹~` 提交于 2019-12-14 02:12:21
问题 I run docker-compose -f docker-compose.prod.yml up and I immediately get the error: ERROR: for frontend Cannot start service frontend: OCI runtime create failed: container_linux.go:348: starting container process caused "process_linux.go:402: container init caused \"rootfs_linux.go:58: mounting \\\"/c/Users/James/Projects/mysite/frontend/conf/nginx/mysite.template\\\" to rootfs \\\"/var/lib/docker/aufs/mnt/e7a2a699ae3e9ede0dd60b7cfdebb7f2d3adf71e8175157f3c9e88d3285796d2\\\" at \\\"/var/lib

Environment variables and @Value can't work together on Spring Boot

时光毁灭记忆、已成空白 提交于 2019-12-14 02:04:43
问题 I have a Spring boot app that connects to a Redis instance that works as a cache. When I'm in dev environment, I have the following: --- spring: profiles: default redis: host: localhost port: 6379 And my cache configuration class is like this: @Configuration @EnableCaching public class CacheConfiguration { @Value("${redis.host}") String redisHost; @Value("${redis.port}") int redisPort; In production, this app is Dockerized, and I have the following docker-compose.yml file: redis: image: tutum

Vulhub搭建

ぃ、小莉子 提交于 2019-12-14 01:25:34
Vulhub是一个比较全面的漏洞集合,收集了近年来许多的重要漏洞,以开源的形式呈现,以docker的形式进行环境配置,提供了更简单的漏洞复现,只需要简单的命令即可实现漏洞复现。 官网 https://vulhub.org 环境打开 service docker start cd /vulhub/activemq/CVE-2015-5254 docker-compose up -d #构建漏洞环境,这个命令包括了docker-compose build 环境关闭 docker-compose down 来源: https://www.cnblogs.com/visionv/p/12037994.html

Variable doesn't expand while passing as a parameter to docker-compose command inside heredoc block

ε祈祈猫儿з 提交于 2019-12-13 20:08:55
问题 I was trying to run some docker-compose command over ssh using bash script like below. I mean I have an executable shell script deploy.sh which contains below code snippets ssh -tt -o StrictHostKeyChecking=no root@142.32.45.2 << EOF DIR=test echo \${DIR} docker-compose --project-name \${DIR} up -d EOF But the DIR variable doesn't get expanded while passing as a parameter to docker-compose. It executes like below. While echo \${DIR} gives correct output i.e test . docker-compose --project-name

Apache in Docker says: Symbolic link not allowed

吃可爱长大的小学妹 提交于 2019-12-13 19:26:47
问题 I use a Docker image: https://github.com/docker-library/php/blob/fec7f537f049aafd2102202519c3ca9cb9576707/5.5/apache/Dockerfile And i use it with docker-compose: apache: build: ./site/docker/apachephp environment: - VIRTUAL_HOST=www.test.dev volumes: - ./site/code:/var/www/app expose: - "80" The code is a symfony app and uses symbolic link in the web folder, but for all assets in the symbolic links i get in the apache logs: AH00037: Symbolic link not allowed or link target not accessible: