Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added the Docker SBT plugin. #2

Merged
merged 2 commits into from
Sep 20, 2015
Merged

Added the Docker SBT plugin. #2

merged 2 commits into from
Sep 20, 2015

Conversation

aj-michael
Copy link
Member

Whoever reviews this, please confirm that you can get the server running on Docker before merging.

It works for me, but it would be great to confirm that I didn't forget to commit set-up files or something.

Part of feature CSSE497/pathfinder#8.

@robinsdm
Copy link
Member

Why are ports 9000 - 9443 open?

@aj-michael
Copy link
Member Author

It's not 9000 - 9443. It's 9000 and 9443. The default Play HTTP port is 9000. The default Play HTTPS port is 9443.

@grovecj
Copy link

grovecj commented Sep 15, 2015

Could not run with the following error:

$ activator docker:publishLocal
[info] Loading project definition from C:\Users\grove\Desktop\pathfinder-webserver\project
[info] Set current project to pathfinder-webserver (in build file:/C:/Users/grove/Desktop/pathfinder-webserver/)
[info] Packaging C:\Users\grove\Desktop\pathfinder-webserver\target\scala-2.11\pathfinder-webserver_2.11-1.0-SNAPSHOT-sources.jar ...
[info] Done packaging.
[info] Main Scala API documentation to C:\Users\grove\Desktop\pathfinder-webserver\target\scala-2.11\api...
[info] Wrote C:\Users\grove\Desktop\pathfinder-webserver\target\scala-2.11\pathfinder-webserver_2.11-1.0-SNAPSHOT.pom
model contains 20 documentable templates
[info] Main Scala API documentation successful.
[info] Packaging C:\Users\grove\Desktop\pathfinder-webserver\target\scala-2.11\pathfinder-webserver_2.11-1.0-SNAPSHOT-javadoc.jar ...
[info] Done packaging.
[info] Packaging C:\Users\grove\Desktop\pathfinder-webserver\target\scala-2.11\pathfinder-webserver_2.11-1.0-SNAPSHOT-web-assets.jar ...
[info] Packaging C:\Users\grove\Desktop\pathfinder-webserver\target\scala-2.11\pathfinder-webserver_2.11-1.0-SNAPSHOT.jar ...
[info] Done packaging.
[info] Done packaging.
[info] Packaging C:\Users\grove\Desktop\pathfinder-webserver\target\scala-2.11\pathfinder-webserver_2.11-1.0-SNAPSHOT-sans-externalized.jar ...
[info] Done packaging.
java.util.regex.PatternSyntaxException: Unexpected internal error near index 1
\
 ^
        at java.util.regex.Pattern.error(Unknown Source)
        at java.util.regex.Pattern.compile(Unknown Source)
        at java.util.regex.Pattern.<init>(Unknown Source)
        at java.util.regex.Pattern.compile(Unknown Source)
        at java.lang.String.split(Unknown Source)
        at java.lang.String.split(Unknown Source)
        at com.typesafe.sbt.packager.docker.DockerPlugin$.com$typesafe$sbt$packager$docker$DockerPlugin$$makeAdd(DockerPlugin.scala:152)
        at com.typesafe.sbt.packager.docker.DockerPlugin$$anonfun$projectSettings$8.apply(DockerPlugin.scala:79)
        at com.typesafe.sbt.packager.docker.DockerPlugin$$anonfun$projectSettings$8.apply(DockerPlugin.scala:70)
        at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
        at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
        at sbt.std.Transform$$anon$4.work(System.scala:63)
        at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
        at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
        at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
        at sbt.Execute.work(Execute.scala:235)
        at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
        at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
        at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
        at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
[error] (*:dockerCommands) java.util.regex.PatternSyntaxException: Unexpected internal error near index 1
[error] \
[error]  ^
[error] Total time: 12 s, completed Sep 15, 2015 2:16:33 PM

@aj-michael
Copy link
Member Author

What is the output of the following commands?

docker-machine -v
docker -v
activator --version

@aj-michael
Copy link
Member Author

It looks like this may be a problem with an older version of SBT that they fixed:

http://stackoverflow.com/questions/30565463/java-util-regex-patternsyntaxexception-when-using-sbt-dockerpublishlocal

sbt/sbt-native-packager#588

It is working for me with sbt launcher version 0.13.8

@grovecj
Copy link

grovecj commented Sep 15, 2015

docker-machine.exe version 0.4.1 (e2c88d6)
Docker version 1.8.2, build 0a8c2e3
sbt launcher version 0.13.8

@aj-michael
Copy link
Member Author

Hmmm, I have the same versions except that I have Docker 1.8.1 instead of Docker 1.8.2. Will investiage.

@grovecj
Copy link

grovecj commented Sep 15, 2015

Are you testing this on linux?

@aj-michael
Copy link
Member Author

I have only tested it on OSX, trying Windows now.

@aj-michael
Copy link
Member Author

Ok, I can reproduce this error on Windows with the same versions as OSX. My hunch is it's a backslash-in-file-path regex problem in the docker stack somewhere.

The old version of SBT Native Packager had a bug that prevented it from working on Windows.
@aj-michael
Copy link
Member Author

Ok, I've found a solution and have now successfully run the project on Docker on Windows.

I added a commit to update the Sbt Native Packager.

There were also a few additional steps:

  1. I restarted the container with docker-machine restart default.
  2. I set the configuration in my cmd prompt with docker-machine env default --shell=cmd and then running the commands that it tells you to run.

@aj-michael
Copy link
Member Author

Resolved in person :shipit:

aj-michael added a commit that referenced this pull request Sep 20, 2015
Added the Docker SBT plugin.
@aj-michael aj-michael merged commit 4a64619 into dev Sep 20, 2015
@aj-michael aj-michael deleted the topic/docker branch September 20, 2015 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants