docker-compose

Same app can't send http request by docker compose

扶醉桌前 提交于 2020-03-23 08:18:33
问题 Spring boot retrofit 2 docker in my docker-compose file: version: "3" services: server: image: asubscriber/eshop:1.0.1 build: . ports: - 8090:8090 Run my app (Spring boot) from console like this: java -jar build/libs/eshop-1.0.1.jar eshop-1.0.1.jar Run success. And success to http request. Here log: [INFO ] 2020-03-14 21:41:09.480 [OkHttp http://localhost:8091/...] OkHttpClient - --> POST http://localhost:8091/api/v1/notifyEmail?emailTo=a_subscriber%40mail.ru&action=order_update&orderId=38

私有Registry--Harbor安装

孤街醉人 提交于 2020-03-22 23:09:06
1,安装docker-compose rpm -ivh https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-11.noarch.rpm yum install docker docker-compose -y systemctl start docker systemctl enable docker 2,安装harbor # 申请ssl证书,在阿里云或腾讯云上申请免费的ssl证书并上传到服务器 # 放置/data/harbor/ssl_cert目录下 mkdir /data/harbor/ssl_cert -pv ls /data/harbor/ssl_cert/ reg.xxxxx.com.crt reg.xxxxx.com.key # 在线安装 下载在线安装包 https://github.com/goharbor/harbor/releases 在上述链接中下载对应的版本,这里使用的是1.5.2版本的,可自行下载最新版的 wget https://storage.googleapis.com/harbor-releases/harbor-online-installer-v1.5.2.tgz tar xvf harbor-online-installer-v1.5.2.tgz cd

Docker Compose Relative paths vs Docker volume

﹥>﹥吖頭↗ 提交于 2020-03-22 09:21:53
问题 I have a docker compose file for a website, which amongst a bunch of other containers for various purposes, includes a mysql database that will have persistent data. At the moment the compose file specifies a relative path for the data, e.g.: mysql: image: mysql:5.7 container_name: sqldb volumes: - ./mysql_data/_data:/var/lib/mysql and the folder structure: --mysql_data --static_content docker-compose.yml which means that at any point I can move the whole site (including persisted content) to

centos 安装 docker-compose

我的梦境 提交于 2020-03-21 11:33:52
3 月,跳不动了?>>> 我使用这玩意就没安装成功过,索性自个直接下载在上传上去 1.下载 docker-compose 使用工具上传至服务器,然后更改文件名 sudo mv docker-compose-Linux-x86_64 /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose 查看docker-compose的版本 docker-compose -v 来源: oschina 链接: https://my.oschina.net/u/4188716/blog/3207697

Centos服务器配置与部署过程

痞子三分冷 提交于 2020-03-21 09:17:25
Centos服务器配置与部署过程 安装与配置docker 1、检查内核版本,必须是3.10及以上 uname -r 2、安装docker yum install docker 3、输入y确认安装 4、启动docker [root@localhost ~]# systemctl start docker [root@localhost ~]# docker -v Docker version 1.12.6, build 3e8e77d/1.12.6 5、开机启动docker [root@localhost ~]# systemctl enable docker Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service. 6、停止docker systemctl stop docker docker配置加速器 #打开文件地址 vim /etc/docker/daemon.json #腾讯服务器加速地址加入 { "registry-mirrors": ["https://mirror.ccs.tencentyun.com"] } #阿里云的服务器请查看:阿阿里云服务器下的容器镜像服务,选择容器加速器

graphqlize docker-compose 运行

让人想犯罪 __ 提交于 2020-03-20 01:05:58
今天有写过简单的graphqlize 基本运行,但是对于使用容器的不太方便,所以基于profile 调整了 添加容器构建参数替换 原理说明 主要是通过profile 以及mvn 的resource 插件进行代码的构建时替换datasource 的配置,对于不同的环境使用不同的配置 pom.xml <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.2.5.RELEASE</version> <relativePath/> <!-- lookup

docker-compose + spring boot + mysql + redis + nginx 发布web应用: part 3

安稳与你 提交于 2020-03-20 00:05:47
经过前两篇文章, docker-compose + spring boot + mysql + redis + nginx 发布web应用: part 1 docker-compose + spring boot + mysql + redis + nginx 发布web应用: part 2 已经可以使用docker-compose发布小型的应用了。其实在开发环境中,我觉得还是挺方便的吧。(个人认为哈) 这里再扯点别的。 1. 个人以为,jenkins是个好东西,其实用jenkins, 前面 part 1, part 2 还可以更简单。 不过这里就研究了。 2. 如果没有配置docker的阿里镜像加速,挂掉是必须的哈。 其实配置阿里的docker加速器,也不太难: 就注册个阿里的开发者帐号就行。 然后就会有你自己的加速配置。 如果想重新开始, 就先 # docker-compose down 如果实在搞不明白,就用docker stop, docker rm 等命令先停掉容器,再一个个删吧。 3. 查看 docker-compose.yml里的 db_data 映射到哪里 # docker volume ls # docker volume inspect compose-demo_db_data 图中红框是实际db_data的位置。 因为这里实际保存mysql的数据

docker 集群 笔记

孤人 提交于 2020-03-19 12:46:30
docker 集群 Docker 容器 移除所有的容器和镜像(大扫除) 用一行命令大扫除: docker kill $(docker ps -q) ; docker rm $(docker ps -a -q) ; docker rmi $(docker images -q -a) 注:shell 中的 $() 和 `` 类似,会先执行这里面的内容,上面的脚本会出现如下 docker kill "pids" ; docker kill 在 docker 中用于停止容器,docker rm 删除容器, docker rmi 删除镜像 当没有运行的容器或者是根本没有容器的时候,这只会提示一个警告信息。当你想尝试的时候,这就是个非常好的单行命令。如果你仅仅想删除所有的容器,你可以运行如下命令: docker kill $(docker ps -q) ; docker rm $(docker ps -a -q) 退出时删除容器 如果你仅仅想在一个容器中快速的运行一个命令,然后退出,并且不用担心容器状态,把 --rm 参数加入 run 命令后面,这将结束很多你保存了的容器,并且清理它们。 示例:docker run --rm -i -t busybox /bin/bash Docker Machine 统一 docker 虚拟机 环境 按照工具 在 docker1.12 后 按照docker

Import docker compose file in another compose file

时光总嘲笑我的痴心妄想 提交于 2020-03-18 15:35:55
问题 Is it possible to "import" or link a docker-compose file into another docker-compose file? Suppose I have two files: # docker-compose-1.yml services: A: # config B: # config # docker-compose-2.yml services: C: # config import: docker-compose-1.yml By running docker-compose -f docker-compose-2.yml up , I would like to start containers A, B (specified in the imported file) and C. Is this possible, without having to link both files with the -f parameter? 回答1: By extending It's possible to extend

Import docker compose file in another compose file

不羁的心 提交于 2020-03-18 15:22:46
问题 Is it possible to "import" or link a docker-compose file into another docker-compose file? Suppose I have two files: # docker-compose-1.yml services: A: # config B: # config # docker-compose-2.yml services: C: # config import: docker-compose-1.yml By running docker-compose -f docker-compose-2.yml up , I would like to start containers A, B (specified in the imported file) and C. Is this possible, without having to link both files with the -f parameter? 回答1: By extending It's possible to extend