简体   繁体   English

Docker Compose与Docker Start

[英]Docker compose vs docker start

I created a jhipster application with mysql.It is running.I can add,delete,list some records etc..MySql is running as docker container.With jenkins, I created another docker image which is called jhipster.Now, I can see my docker images with docker images command.I want to start my jhipster application as container but which commmand do I have to use?(docker-compose up -d or docker start containerID) 我用mysql创建了一个jhipster应用程序。它正在运行。我可以添加,删除,列出一些记录等..mySql作为docker容器运行。使用jenkins,我创建了另一个名为jhipster的docker镜像。现在,我可以看到我的我想将我的jhipster应用程序作为容器启动,但是我必须使用哪个命令?(docker-compose up -d或docker start containerID)

I have no docker-compose.yml file but I have app.yml file which is generated by jhipster.And app.yml refers mysql.yml file.Now,mysql container is running but there is no container about jhipster.Also, according to my dockerfile,jenkins should create app.war but I cannot find that war in my remote ubuntu machine.From this point,which steps do I should follow? 我没有docker-compose.yml文件,但是有jhipster生成的app.yml文件.app.yml引用了mysql.yml文件。现在,mysql容器正在运行,但是没有关于jhipster的容器。我的dockerfile,jenkins应该创建app.war,但在远程ubuntu机器上找不到该战争。从这一点来看,我应该遵循哪些步骤? Do you have any idea? 你有什么主意吗?

The docker cli is used when managing individual containers on a docker engine. 在docker引擎上管理单个容器时使用docker cli。 It is the client command line to access the docker daemon api. 这是访问docker daemon api的客户端命令行。

The docker-compose cli can be used to manage a multi-container application. docker-compose cli可用于管理多容器应用程序。 It also moves many of the options you would enter on the docker run cli into the docker-compose.yml file for easier reuse. 它还会将您将在docker run cli上输入的许多选项移到docker-compose.yml文件中,以方便重用。

As you have only single container image jhipster , then you should use docker cli to run that image as container. 由于您只有一个容器映像jhipster ,因此应使用jhipster cli将该映像作为容器运行。

You can run following command: 您可以运行以下命令:

docker images

It will give you the name of the image, then run: 它将为您提供图像的名称,然后运行:

docker run image_name:tag_name

If you don't provide any tag name it will run with latest tag 如果您不提供任何标签名称,它将以latest标签运行

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM