LoginSignup
4
4

More than 5 years have passed since last update.

herokuでdocker使うときに躓いたポイント

Posted at

docker使ってherokuにでぷろーいしようとして詰まったところを備忘録る

起きてた問題

heroku docker:init

して、Dockerfileを色々書いてローカルでは正しく動いてたのにheroku上ではコケた!

コンソールを見ると、apt-get installしといたはずの子が見つからないと言う…

解決方法

インストール先は/app以下にする。

そう、それだけ。

問題のポイント

これは、herokuの仕様によるものでした。
dockerだからと言って、好き勝手に環境いじり倒せるかと言ったらそういう訳じゃなかったそうです。

詳しくは、公式のドキュメントを見ると良いのですが重要なポイントを掻い摘むと…

Modifying the Dockerfile
This is because the slugs created from the Docker container must conform to the Heroku slug format:
FROM heroku:cedar:14
changes localized to the /app directory

つまり、heroku/cedar/14のイメージを使って、環境に変更を加える様な事をするときは
/app
以下でやってね!
ということでした。
ということは、状況はheroku & gitの開発の時と同じ感じということか…

ということで、/app/binと/app/source
みたいにディレクトリ切って、/app/binに独自に導入したいものを置くのが良さそう。

apt-getは/usr/binにインストールしちゃうので、欲しい子たちはソースからビルドする事にする。

4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4