docker-compose

Postgres, Go Docker compose wait-for-it.sh no such file or directory

放肆的年华 提交于 2019-12-13 03:18:33
问题 Been racking my head about this one for almost two days. I'm new to Docker and Docker Compose, and trying to run my image on an EC2 instance running Postgres and Go. When I run docker-compose up, the db service runs successfully, but not the app service. When I try to run the services separately using: docker-compose up db all is good then run: docker-compose up app I get... app_1 | wait-for-it.sh: waiting 15 seconds for db:5432 app_1 | wait-for-it.sh: db:5432 is available after 0 seconds app

Does stopping docker-compose containers unmount volumes?

ε祈祈猫儿з 提交于 2019-12-13 03:04:08
问题 As part of my quest to completely understand how docker deals with volumes under the hood (followup from my previous post), I'm curious about how running docker-compose stop deals with volumes. There are two possibilities that I suppose may happen: Volumes are unmounted after running docker-compose stop and then mounted again in lexographic order when running docker-compose start . Volumes stay mounted until the container is removed using docker-compose rm or a similar command. I was curious

Import data in json to mongo container docker

余生长醉 提交于 2019-12-13 02:55:55
问题 I have a question. I'm starting learn docker. I know how create a container, now I try import data(json) to my container mongo, but I don't know how I can make this. Can you help me and give a simple solution for this? With Docker-compose. My container - mongo My file - data.json Thanks! 回答1: You can not import JSON simply using docker-compose. you need to place the data in js file and mount the js file with /docker-entrypoint-initdb.d When a container is started for the first time it will

redis connect timeout to remote server in a docker

a 夏天 提交于 2019-12-13 01:25:01
问题 I start a redis container with docker-compose in machine A. docker-compose.yml. redis: ports: - "6379:6379" image: redis on machine A, I can connect to it with redis-cli in terminal. redis-cli 127.0.0.1:6379> But I can't connect to it use A's IP on machine B even on machine A itself. on machine B or A. redis-cli -h 10.10.10.25 Could not connect to Redis at 10.10.10.25:6379: Connection timed out not connected> 回答1: It's strange. I can run redis-cli on both host A and host B with A's IP.

docker/docker-compose常用命令与配置

一个人想着一个人 提交于 2019-12-13 01:13:55
今天整理了些以前使用docker时常用的命令与配置,在这里分享出来,也便于自己日后查阅。文中不包括docker的基本概念、安装,还请自行搜寻。 各位感兴趣的话,可以自存一份。 docker 一、docker基础操作 service docker start/stop/restart 二、镜像基础操作 1.搜索镜像: docker search imageName 2.拉取搜索出的镜像: docker pull 镜像名; 3.修改镜像名 docker tag 旧镜像名:tag 新镜像名:tag 4.查看当前镜像列表: docker images 三、容器基础操作(对已经启动的镜像操作) --1.显示所有容器 docker ps -a --2.显示当前运行中的容器 docker ps --3.启动容器 docker start containerId --4.停止容器 docker stop containerId --5.重启容器 docker restart containerId --6.删除容器 docker rm containerId 四、从无到有构建一个新的镜像(基于已有镜像,创建一个新的镜像),并启动 1.随意创建一个文件夹; 2.创建Dockerfile文件(名字只能为 Dockerfile),内容如下: #镜像来源 FROM centos:latest #作者

tomcat + mysql + war using docker-compose.yml

你说的曾经没有我的故事 提交于 2019-12-13 00:47:16
问题 I am using docker-compose.yml to build my enviroment. docker-compose.yml version: '3' services: mysql: image: mysql:5.5 container_name: mysql restart: always environment: MYSQL_DATABASE: my-test-app MYSQL_ROOT_PASSWORD: root volumes: - ./docker/db:/docker-entrypoint-initdb.d ports: - "3306:3306" tomcat: image: tomcat:8.5.35 container_name: tomcat volumes: - ./docker/myapp.war:/usr/local/tomcat/webapps/myapp.war ports: - "8080:8080" My folder structore my-env ├── docker-compose.yml ├── docker

How's spotify dockerfile-maven-plugin uses “docker-compose build”?

狂风中的少年 提交于 2019-12-13 00:09:41
问题 From the docs https://github.com/spotify/dockerfile-maven, it says: For example, a docker-compose.yml might look like: service-a: build: a/ ports: - '80' service-b: build: b/ links: - service-a Now, docker-compose up and docker-compose build will work as expected. But how to write the pom.xml file, still like as if not using compose? Set the goal to be "build"? <plugin> <groupId>com.spotify</groupId> <artifactId>dockerfile-maven-plugin</artifactId> <executions> <execution> <id>default</id>

nuxt.js 服务端部署

我与影子孤独终老i 提交于 2019-12-12 23:20:02
这次 nuxt.js 服务端部署以docker为基础部署,这样解决以下这些问题: 1. 服务器里一般不搭建运行环境,可以直接以docker里的为环境,统一部署,而不用再次搭建运行环境 2. 常常出现本地没问题,到了服务端上部署时一堆错误,本地和服务器统一用docker里的环境打包部署,解决npm install,npm build等部署出现的错误,方便快捷 一。开始部署 准备如下项目 nuxt为需要部署的nuxt.js项目,名称随意,但需要和yml文件里的对应 nuxt-compose.yml 文件如下配置 version: '3' services: node: image: node:10.9.0 working_dir: /nuxt_vue ports: - 3000:3000 volumes: - ./nuxt:/nuxt_vue networks: core_network: aliases: - vue entrypoint: - bash - -c - | npm config set registry https://registry.npm.taobao.org npm install networks: core_network: driver: bridge Node 的镜像版本需要和开发的一样,不然安装依赖等可能会出错 容器里设置 npm 的淘宝镜像

Docker compose mysql connection failing

落爺英雄遲暮 提交于 2019-12-12 21:53:20
问题 I am trying to run 2 docker containers using docker-compose and connect mysql container to app container.Mysql container is running but app container is failing to start with the error Error:2003: Can't connect to MySQL server on '127.0.0.1:3306' (111 Connection refused) It seems like my app container is trying to connect my host mysql instead of mysql container. docker-compose.yml version: '2' services: mysql: image: mysql:5.7 container_name: database environment: MYSQL_ROOT_PASSWORD: root

Setup aspnetcore with MySQL database in docker

拥有回忆 提交于 2019-12-12 21:05:20
问题 I'm trying to set up a docker-compose file with a container for asp.net-core, mysql database and phpmyadmin. There is no problem setting up my mysql-server, I can access it with phpmyadmin. Also my asp.net-core application is running correctly and I can access it in the browser. However, I am not able to make a connection with my MySQL database. The application keeps returning: Unable to connect to any of the specified MySQL hosts The application is connecting through a connection string in