无法在Heroku上部署Laravel应用程序的Docker映像 [英] Unable to deploy the Docker Image of Laravel application on Heroku

查看:87
本文介绍了无法在Heroku上部署Laravel应用程序的Docker映像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始学习Docker.我是Docker的完整入门者.现在,我正在尝试将Laravel应用程序的Docker映像部署到Heroku上.我已经安装了Laravel项目.我的Laravel项目只有一页,欢迎页面显示一条消息.就是这样.我只是想测试Docker.我已经为Laravel项目创建了一个Docker映像,并按照以下说明在笔记本电脑上成功运行了该映像.

我在项目根文件夹中创建了一个Dockerfile,内容如下.

  FROM php:7运行apt-get update -y&&apt-get install -y openssl zip解压缩git运行curl -sS https://getcomposer.org/installer |php---install-dir =/usr/local/bin --filename = composer运行docker-php-ext-install pdo mbstringWORKDIR/app复制 ./应用程序RUN composer安装CMD PHP工匠服务--host = 0.0.0.0 --port = 8181展览8181 

然后我像这样构建图像

  docker build -t waiyanhein/laravel c:/xampp/htdocs/docker_laravel 

然后我通过运行以下命令在本地运行它.

  docker run –p 8181:8181 waiyanhein/laravel 

一切正常.然后,我尝试将映像部署到Heroku.我点击了此链接,

然后,通过运行以下命令,如链接中所述,将其作为下一步进行推送.

  heroku容器:推送网络 

运行上面的命令时,出现以下错误.

 »错误:缺少必需的标志:»-a,--app对以下应用运行命令的APP应用»有关--help的更多帮助 

出了什么问题?如何轻松将Laravel Docker的映像部署到Heroku?

解决方案

它要求您指定应用名称

heroku容器:推送网络--app dockerlaravelwai

I started to learn the Docker. I am a complete beginner to Docker. Now, what I am doing is trying to deploy a Docker image of Laravel application onto the Heroku. I have installed a Laravel project. My Laravel project has only one page, a welcome page showing a message. That's it. I am just trying to test Docker. I have created a Docker image for my Laravel project and successfully run it on my laptop as follow.

I created a Dockerfile in the project root folder with the following content.

FROM php:7
RUN apt-get update -y && apt-get install -y openssl zip unzip git
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
RUN docker-php-ext-install pdo mbstring
WORKDIR /app
COPY . /app
RUN composer install

CMD php artisan serve --host=0.0.0.0 --port=8181
EXPOSE 8181

Then I built the image like this

docker build -t waiyanhein/laravel c:/xampp/htdocs/docker_laravel

Then I run it locally by running the following command.

docker run –p 8181:8181 waiyanhein/laravel

Everything was working. Then I tried to deploy the image to Heroku. I followed this link, https://devcenter.heroku.com/articles/container-registry-and-runtime. As in the link, I logged into heroku.

heroku container:login

Login succeeded. Then I create the app running this command.

heroku create dockerlaravelwai

The command was successful and this is the result.

Then I pushed it as a next step as in the link mention by running the following command.

heroku container:push web

when I run the above command, I got the following error.

 »   Error: Missing required flag:
 »     -a, --app APP  app to run command against
 »   See more help with --help

What went wrong? How can I easily deploy the Laravel Docker's image to Heroku?

解决方案

Its asking for you to specify the app name

heroku container:push web --app dockerlaravelwai

这篇关于无法在Heroku上部署Laravel应用程序的Docker映像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆