2016-05-29 6 views
1

初めてDockerを使用しています。私はそれを正しくインストールし、デーモンサービスは必要であると言うように動作しています。だから、フレームワークとスケーラ言語で構築されたシンプルなWebアプリがあります。 "sbt docker:publishLocal"を実行した後、 "イメージ再生 - スケーラブック構築:1.0-SNAPSHOT"が成功しました。私は "DOCKER_HOST = tcp://192.168.0.8:2375"をエクスポートします。私built.sbtは>>私のプレイスカラアプリをドッキングする方法は?

// import NativePackagerKeys._ 
// setting a maintainer which is used for all packaging types 
maintainer := "Felipe Oliveira Gutierrez" 
// exposing the play ports 
dockerExposedPorts in Docker := Seq(9000, 9443) 

name := """play-scala-book""" 
version := "1.0-SNAPSHOT" 
lazy val root = (project in file(".")).enablePlugins(PlayScala) 
scalaVersion := "2.11.7" 

libraryDependencies ++= Seq(
    jdbc, 
    cache, 
    ws, 
    evolutions, 
    "com.typesafe.play" %% "anorm" % "2.4.0", 
    "commons-codec" % "commons-codec" % "1.6", 
    specs2 % Test 
) 
resolvers += "scalaz-bintray" at "http://dl.bintray.com/scalaz/releases" 
// enablePlugins(JavaAppPackaging) 

あるしかし、私は実行すると、 "ドッキングウィンドウの実行を-p 9000:9000のプレイのscala-ブック:1.0-SNAPSHOT" 私が得たこのエラー>>

[info] application - Creating Pool for datasource 'default' 
[info] p.a.d.DefaultDBApi - Database [default] connected at jdbc:h2:mem:play 
[error] o.j.StatementLogger - java.sql.Statement.executeQuery: select id, hash, apply_script, revert_script, state, last_problem from play_evolutions where state like 'applying_%'; 
throws exception: org.h2.jdbc.JdbcSQLException: Table "PLAY_EVOLUTIONS" not found; SQL statement: 
select id, hash, apply_script, revert_script, state, last_problem from play_evolutions where state like 'applying_%' [42102-191] 
org.h2.jdbc.JdbcSQLException: Table "PLAY_EVOLUTIONS" not found; SQL statement: 
select id, hash, apply_script, revert_script, state, last_problem from play_evolutions where state like 'applying_%' [42102-191] 
    at org.h2.message.DbException.getJdbcSQLException(DbException.java:345) 
    at org.h2.message.DbException.get(DbException.java:179) 
    at org.h2.message.DbException.get(DbException.java:155) 
    at org.h2.command.Parser.readTableOrView(Parser.java:5349) 
    at org.h2.command.Parser.readTableFilter(Parser.java:1245) 
    at org.h2.command.Parser.parseSelectSimpleFromPart(Parser.java:1884) 
    at org.h2.command.Parser.parseSelectSimple(Parser.java:2032) 
    at org.h2.command.Parser.parseSelectSub(Parser.java:1878) 
    at org.h2.command.Parser.parseSelectUnion(Parser.java:1699) 
    at org.h2.command.Parser.parseSelect(Parser.java:1687) 
[warn] p.a.d.e.ApplicationEvolutions - Your production database [default] needs evolutions! 

# --- Rev:1,Ups - 96578d1 
CREATE SEQUENCE book_id_seq; 

CREATE TABLE book (
id integer NOT NULL DEFAULT nextval('book_id_seq'), 
label varchar(255), 
added bigint 
); 

[warn] p.a.d.e.ApplicationEvolutions - Run with -Dplay.evolutions.db.default.autoApply=true if you want to run them automatically (be careful) 
[error] p.a.l.c.CryptoConfigParser - The application secret has not been set, and we are in prod mode. Your application is not secure. 
[error] p.a.l.c.CryptoConfigParser - To set the application secret, please read http://playframework.com/documentation/latest/ApplicationSecret 
[error] p.a.l.c.CryptoConfigParser - The application secret has not been set, and we are in prod mode. Your application is not secure. 
[error] p.a.l.c.CryptoConfigParser - To set the application secret, please read http://playframework.com/documentation/latest/ApplicationSecret 
[error] p.a.l.c.CryptoConfigParser - The application secret has not been set, and we are in prod mode. Your application is not secure. 
[error] p.a.l.c.CryptoConfigParser - To set the application secret, please read http://playframework.com/documentation/latest/ApplicationSecret 
[info] application - ApplicationTimer demo: Starting application at 2016-05-29T15:57:43.182Z. 
[error] p.a.l.c.CryptoConfigParser - The application secret has not been set, and we are in prod mode. Your application is not secure. 
[error] p.a.l.c.CryptoConfigParser - To set the application secret, please read http://playframework.com/documentation/latest/ApplicationSecret 
[error] p.a.l.c.CryptoConfigParser - The application secret has not been set, and we are in prod mode. Your application is not secure. 
[error] p.a.l.c.CryptoConfigParser - To set the application secret, please read http://playframework.com/documentation/latest/ApplicationSecret 
[error] p.a.l.c.CryptoConfigParser - The application secret has not been set, and we are in prod mode. Your application is not secure. 
[error] p.a.l.c.CryptoConfigParser - To set the application secret, please read http://playframework.com/documentation/latest/ApplicationSecret 
Oops, cannot start the server. 
@708n7c3af: Database 'default' needs evolution! 
    at play.api.db.evolutions.ApplicationEvolutions$$anonfun$play$api$db$evolutions$ApplicationEvolutions$$runEvolutions$1.apply$mcV$sp(ApplicationEvolutions.scala:75) 
    at play.api.db.evolutions.ApplicationEvolutions.withLock(ApplicationEvolutions.scala:99) 
    at play.api.db.evolutions.ApplicationEvolutions.play$api$db$evolutions$ApplicationEvolutions$$runEvolutions(ApplicationEvolutions.scala:49) 
    at play.api.db.evolutions.ApplicationEvolutions$$anonfun$start$1.apply(ApplicationEvolutions.scala:42) 
    at play.api.db.evolutions.ApplicationEvolutions$$anonfun$start$1.apply(ApplicationEvolutions.scala:42) 
    at scala.collection.immutable.List.foreach(List.scala:381) 
    at play.api.db.evolutions.ApplicationEvolutions.start(ApplicationEvolutions.scala:42) 
    at play.api.db.evolutions.ApplicationEvolutions.<init>(ApplicationEvolutions.scala:150) 
    at play.api.db.evolutions.ApplicationEvolutionsProvider.get$lzycompute(EvolutionsModule.scala:53) 
    at play.api.db.evolutions.ApplicationEvolutionsProvider.get(EvolutionsModule.scala:53) 
    at play.api.db.evolutions.ApplicationEvolutionsProvider.get(EvolutionsModule.scala:44) 
    at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:81) 
    at com.google.inject.internal.BoundProviderFactory.provision(BoundProviderFactory.java:72) 
    at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:61) 
    at com.google.inject.internal.BoundProviderFactory.get(BoundProviderFactory.java:62) 
    at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46) 
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103) 
    at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40) 
    at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:145) 
    at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41) 
    at com.google.inject.internal.InternalInjectorCreator$1.call(InternalInjectorCreator.java:205) 
    at com.google.inject.internal.InternalInjectorCreator$1.call(InternalInjectorCreator.java:199) 
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092) 
    at com.google.inject.internal.InternalInjectorCreator.loadEagerSingletons(InternalInjectorCreator.java:199) 
    at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:180) 
    at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:110) 
    at com.google.inject.Guice.createInjector(Guice.java:96) 
    at com.google.inject.Guice.createInjector(Guice.java:84) 
    at play.api.inject.guice.GuiceBuilder.injector(GuiceInjectorBuilder.scala:181) 
    at play.api.inject.guice.GuiceApplicationBuilder.build(GuiceApplicationBuilder.scala:123) 
    at play.api.inject.guice.GuiceApplicationLoader.load(GuiceApplicationLoader.scala:21) 
    at play.core.server.ProdServerStart$.start(ProdServerStart.scala:47) 
    at play.core.server.ProdServerStart$.main(ProdServerStart.scala:22) 
    at play.core.server.ProdServerStart.main(ProdServerStart.scala) 

オン私のconf/application.conf私はこれを持っています>

play.evolutions { 
    # You can disable evolutions for a specific datasource if necessary 
    db.default.enabled = true 
    db.default.autoApply = true 
} 
+0

データベースエラーまたはアプリケーションのシークレットエラーを解決しますか? – Hugo

+0

これは、私がドッキングできないようにするための大きなエラーだと思う "サーバーを起動できません@ 708n7c3af:データベース 'デフォルト'には進化が必要です!しかし私はすでに私の図書館に進化しています。私はちょうどあなたのapplication.confファイルを見つけることができません –

+0

私のアプリをドッキングしたいですか? application.confに適切なアプリケーションの秘密を設定してみてください。これでアプリケーションの秘密の問題が解決されず、Michael Vaughanの答えがうまくいかない場合は、アプリがapplication.confを見つけることができるかどうかを確認する必要があります。 – Hugo

答えて

0

アップアップを自動適用するように設定されているようには見えません。下の行をapplication.confに追加して、もう一度お試しください。

play.evolutions.db.default.autoApply=true

+0

いいえ、エラーは同じです –

+0

あなたのスキーマに 'play_evolutions'という名前のテーブルがありますか? –

+0

はい、元の質問を編集して私のapplication.confにあるものを表示します –

関連する問題