docker在AWS EC2上拉入后无法找到项目文件夹

时间:2019-04-16 15:59:15

标签: docker amazon-ec2 docker-compose pull

[ec2-user@ip-... ~]$ sudo yum update -y
    // ok
[ec2-user@ip-... ~]$ sudo amazon-linux-extras install docker
    // ok
[ec2-user@ip-... ~]$ sudo service docker start
    // ok
[ec2-user@ip-... ~]$ sudo usermod -a -G docker ec2-user
    // ok
[ec2-user@ip-... ~]$ docker login
    // ok
[ec2-user@ip-... ~]$ mkdir myprojectfolder
    // ok
[ec2-user@ip-... ~]$ cd myprojectfolder
    // ok
[ec2-user@ip-... ~]$ docker pull myusername/myproject:latest
    // apparently ok (if I try doing it again it says that
    // the image is present and at the latest version)
[ec2-user@ip-... ~]$ docker-compose up
    // ERROR:
    //    Can't find a suitable configuration file in this directory or any
    //    parent. Are you in the right directory?

    //    Supported filenames: docker-compose.yml, docker-compose.yaml

myprojectfolder文件夹似乎为空,即使拉取成功。也许EC2将docker的东西放在另一个预定的文件夹中?如果我不进入该文件夹,我将无法继续使用docker-compose。

在AWS EC2上启动Docker项目时哪里出错了?

1 个答案:

答案 0 :(得分:0)

您没有下载文件夹,正在下载图像,可以通过docker images查看。试试:

docker run -d --name myprojectName myusername/myproject:latest

这将启动您的docker。请记住,您可以使用-it代替-d来使用交互式选项。