Heroku Docker部署 [英] Heroku docker deployment
问题描述
我一直在关注本文 https://devcenter.heroku.com/文章/容器注册和运行时,而我陷入了 heroku container:push的困境。我运行 heroku container:push --app mediabox,并正确构建了docker映像,然后开始将其推送到注册表,这就是我得到的:
I was following the this article https://devcenter.heroku.com/articles/container-registry-and-runtime and I'm stuck with "heroku container:push". I run "heroku container:push --app mediabox" and the docker image is properly build and then it start to push it to registry and this is what I get:
Successfully built 7926b98d51b5
The push refers to a repository [registry.heroku.com/mediabox/web]
38d48dd6de30: Preparing
969058e6ddc9: Preparing
2f454953e0e7: Preparing
f67c1ecd32a1: Preparing
44fade3982ca: Preparing
0accb1c81980: Waiting
e79bbdfaa0d3: Waiting
1be5d1797b73: Waiting
5c0a4f4b3a35: Waiting
011b303988d2: Waiting
error parsing HTTP 400 response body: unexpected end of JSON input: ""
! Error: docker push exited with 1
这是我的Dockerfile:
This is my Dockerfile:
FROM ruby:2.3.1-alpine
RUN apk --update --no-cache add build-base less libxml2-dev libxslt-dev nodejs postgresql-dev && mkdir -p /app
WORKDIR /app
COPY Gemfile Gemfile.lock ./
RUN gem install bundler
RUN bundle
COPY . ./
CMD ["script/docker-entrypoint.sh"]
我在这里找不到解决方案。谢谢您的帮助。
I can't find the solution here. Thanks for your help.
推荐答案
当我忘记运行 heroku container:login <时遇到了这个问题。 / code>。即使您登录到heroku,heroku容器服务也需要单独登录。这就是为什么您在上传开始时就得到错误消息的原因-您未经授权。
I had this problem when I forgot to run heroku container:login
. Even if you're logged in to heroku, heroku container service requires a separate login. That's why you're getting the error right at the beginning of the upload - you are not authorised.
这篇关于Heroku Docker部署的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!