LoginSignup
7
7

More than 5 years have passed since last update.

PlayFrameworkをElastic Beanstalkのt2.microのdockerにdeployする

Posted at

addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.0.0-M1")
Native memory allocation (malloc) failed to allocate 715849728 bytes for committing reserved memory.

build.sbtに下記を追記する。

def creteEbextensions: Unit = {
  val directory = new File("target/docker/.ebextensions")
  val file = new File("target/docker/.ebextensions/env.config")
  val contents =
    """commands:
      |  01_enable_sudo:
      |    command: "echo Defaults:root !requiretty >> /etc/sudoers"
      |    test: "test ! -e /home/ec2-user/swapdone"
      |  02_dd:
      |    command: "sudo dd if=/dev/zero of=/swapfile bs=1M count=1024"
      |    test: "test ! -e /home/ec2-user/swapdone"
      |  03_mkswap:
      |    command: "sudo mkswap /swapfile"
      |    test: "test ! -e /home/ec2-user/swapdone"
      |  04_swapon:
      |    command: "sudo swapon /swapfile"
      |    test: "test ! -e /home/ec2-user/swapdone"
      |  05_swapdone:
      |    command: "touch /home/ec2-user/swapdone"
      |    test: "test ! -e /home/ec2-user/swapdone"
    """.stripMargin
  IO.createDirectory(directory)
  IO.write(file, contents)
}

(stage in Docker) <<= stage in Docker andFinally creteEbextensions
7
7
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
7
7