docker-compose

How to substitute variable value in “docker run” command

浪子不回头ぞ 提交于 2019-12-20 06:33:51
问题 I am using a bash script and trying to assign a fingerprint value as below export FINGERPRINT=D0:19:C5:80:42:66:56:AC:6F docker run --rm -i -v /var/run/docker.sock:/var/run/docker.sock --name ucp docker/ucp join --replica --fingerprint $FINGERPRINT However, bash is not at all substituting the value of $FINGERPRINT 回答1: Try this: export FINGERPRINT=D0:19:C5:80:42:66:56:AC:6F echo `docker run --rm -i -v /var/run/docker.sock:/var/run/docker.sock --name ucp docker/ucp join --replica --fingerprint

How to deploy an Angular application and a REST Api in individual docker containers?

女生的网名这么多〃 提交于 2019-12-20 06:17:45
问题 I have a very similar question as this one. I do have an Angular application that collects data which are then processed via a REST Api. I can happily dockerize both applications and they run fine locally, however, when I try deploy them to make them accessible from "everywhere" I can only reach the front end, but the connection to REST Api is not functional. Inside my Angular app, I have a file baseurl.ts . That just contains: export const baseURL = 'http://localhost:3000/'; I make the

How to get the port numbers for a service - Docker compose file

拟墨画扇 提交于 2019-12-20 06:14:56
问题 I am trying to start containers with the docker-compose.yml. I am trying to start two services, one is mongo and other is OHIF viewer . Currently I am able to access mongo locally (localhost:27017(after port-forwarding) in desktop whereas OHIF viewer isn't possible (ports aren't visible/empty so, I am not able to access them locally). Can you guide me as to how I can set them? As you can see from my docker-compose file that I have set network_mode:"host" to be able to access them locally in

Docker搭建私有仓库(registry与Harbor)

会有一股神秘感。 提交于 2019-12-20 02:12:09
随着docker使用的镜像越来越多,就需要有一个保存镜像的地方,这就是仓库。目前常用的两种仓库:公共仓库和私有仓库。最方便的就是使用公共仓库上传和下载,下载公共仓库的镜像是不需要注册的,但是上传时,是需要注册的。 私有仓库最常用的就是registry、Harbor两种,那接下来详细介绍如何创建私有仓库。 一、搭建registry私有仓库 1)案例描述 两台docker服务器,dockerA创建registry私有仓库,dockerB用于测试! 2)案例实例 (1)DockerA服务器的操作 [root@dockerA ~]# docker pull registry:2 //下载registry:2的镜像 [root@dockerA ~]# docker run -itd --name registry --restart=always -p 5000:5000 -v /registry:/var/lib/registry registry:2 //创建一个registry容器来运行registry服务; //-p:端口映射(前面是宿主机端口:后面是容器暴露的端口); //-v:挂载目录(前面是宿主机的目录:后面的是容器的目录)自动创建宿主机的目录; //--restart=always:随docker服务的启动而启动! [root@dockerA ~]# docker ps /

Declare env variable which value include space for docker/docker-compose

喜你入骨 提交于 2019-12-19 16:16:23
问题 I have an env variable value like this: TEST_VAR=The value Do anybody knowns whether this is legal? should I place " around the value for this to be interpreted as needed in docker? Thanks EDIT : Quotation marks will not be a good solution as it is will be part of the val see reference here. 回答1: Lets see the result running the following compose file: version: "3" services: service: image: alpine command: env env_file: env.conf env.conf: TEST_VAR1=The value TEST_VAR2="The value2" docker

Declare env variable which value include space for docker/docker-compose

烂漫一生 提交于 2019-12-19 16:14:04
问题 I have an env variable value like this: TEST_VAR=The value Do anybody knowns whether this is legal? should I place " around the value for this to be interpreted as needed in docker? Thanks EDIT : Quotation marks will not be a good solution as it is will be part of the val see reference here. 回答1: Lets see the result running the following compose file: version: "3" services: service: image: alpine command: env env_file: env.conf env.conf: TEST_VAR1=The value TEST_VAR2="The value2" docker

docker-compose volumes_from usage example

自古美人都是妖i 提交于 2019-12-19 14:58:13
问题 Can you please provide an example to sharing a path using volumes_from from container A to Container B, in addition how container B can access this path after sharing is done. Thanks 回答1: As documentation said volumes if you are in version 3 you can use The top-level volumes to define a named volume as db-data ee code below and you can reference it in every services something like this: version: "3" services: web: nginx:alpine ports: - "80:80" postgres: image: postgres:9.4 volumes: - db-data:

“Remove” a VOLUME in a Dockerfile

若如初见. 提交于 2019-12-19 12:23:41
问题 I have a Dockerfile extending FROM an image that declares a VOLUME . Is there a way to overwrite the VOLUME directive in such a way, that it "removes" the VOLUME ? 回答1: No. The only way to do so, is if you clone Dockerfile of the image you use as base one (the one in FROM ) and remove the VOLUME directive manually. Then build it and use in your FROM as base one. 回答2: There are cases when you can not modify the original Dockerfile - in my case an image from production. The only chance is to

SpringBoot in Docker not connecting to Mongo in Docker

末鹿安然 提交于 2019-12-19 11:29:14
问题 I have a Spring Boot Application and developed it with a mongo db which was running in brew services. To get a connection to the db I just had to put the following into application.properties in Spring Boot spring.data.mongodb.uri=mongodb://localhost:27017/db changing the application properties to spring.data.mongodb.uri=mongodb://mongo:27017/db didtn't change anything, same Error as before. Now I'm trying to put the SpringBoot Application and the MongoDB into Docker-Containers, but cant get

Encountered errors while bringing up the project

让人想犯罪 __ 提交于 2019-12-19 10:52:13
问题 I have a problem when I am installing odoo 10 by docker. I can't compose up docker.error while creating mount source path. People can help me! Thanks! ERROR: for dockercomposeodoo100_odoo10_1 Cannot start service odoo10: b"error while creating mount source path '/host_mnt/c/Users/hoang/Downloads/docker-compose-odoo-10.0/o_etc': mkdir /host_mnt/c/Users/hoang/Downloads: permission denied" ERROR: for odoo10 Cannot start service odoo10: b"error while creating mount source path '/host_mnt/c/Users