Comments (10)
Hi @ashishsoni,
The formatting of the image
property for the frontendapi
does not look correct. I would think that you would want to format it as: image: frontendapi:latest
The compose instance is failing to start because it cannot find the frontendapi image:
repository frontendapi not found: does not exist or no pull access
. Does the frontendapi image exist locally or in the docker registry?
This looks like it would also be an issue if you used this docker-compose file directly with Docker outside of the plugin.
from sbt-docker-compose.
see below i have execute the compose command directly from the terminal and no issues and also i havent change the file at all.
[spark@Mindstorm frontendapi]$ cd docker/
[spark@Mindstorm docker]$ docker-compose up -d
Creating network "docker_default" with the default driver
Creating docker_frontendapi_1
[spark@Mindstorm docker]$
spark@Mindstorm docker]$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
3eb10f38560d frontendapi:latest "java -cp /app/:/a..." 6 minutes ago Up 6 minutes 0.0.0.0:5006->5005/tcp docker_frontendapi_1
f820613135cf haproxy "/docker-entrypoin..." 2 days ago Exited (0) 37 hours ago haproxy
31af3095d253 pixel/postgres "/bin/bash /start_..." 3 weeks ago Exited (137) 3 weeks ago pixel_postgres
8fad986f912d cassandra:latest "/docker-entrypoin..." 6 weeks ago Exited (143) 37 hours ago cassandra
When i run the sbt dockerComposeUP it build the images but doesnt start the containers and fails.
see attached.
from sbt-docker-compose.
If you can attach the full output from the dockerComposeUp
command it would be very helpful in getting to the root cause of the issue.
The docker-compose.txt
file you attached has the definition for the backendapi
but the output you showed from running docker-compose directly is from starting the frontendapi
. Also, any example build.sbt config you can provide showing how the plugin is configured would be helpful. Trying it myself I was able to correctly start up an instance of the docker-compose.txt file using the plugin.
from sbt-docker-compose.
Hi Do you have a bitbucket user name or email id i can provide you access of the repo and you can reproduce
from sbt-docker-compose.
I have attached the whole project , Please try
justbuyapi.tar.gz
from sbt-docker-compose.
Hi @ashishsoni,
I believe that the issue is since you are running only from the sub-projects and not from the root you need to also define the dockerImageCreationTask
setting in the sub-projects.
There should have been a warning message printed to the output indicating this:
***Warning: The 'dockerImageCreationTask' has not been defined. Please configure this setting to have Docker images built.***
When I add the setting dockerImageCreationTask := docker.value
to the frontendapi
and backendapi
sub-projects directly I am able to start them successfully with dockerComposeUp
.
lazy val frontendapi = project.from("frontendapi")
.setName("frontendapi")
.setDescription("front end")
.setInitialCommand("_")
.configureModule
.dependsOnProjects(common)
.enablePlugins(sbtdocker.DockerPlugin, DockerComposePlugin)
.settings(assmSettings)
.settings(
dockerImageCreationTask := docker.value,
dockerfile in docker := {
new Dockerfile {
val mainClassString = (mainClass in Compile).value.get
val classpath = (fullClasspath in Compile).value
from("java")
add(classpath.files, dockerAppPath)
entryPoint("java", "-cp", s"$dockerAppPath:$dockerAppPath/*", s"$mainClassString")
}
},
imageNames in docker := Seq(ImageName(
repository = name.value.toLowerCase,
tag = Some("latest"))
)
)
Hopefully that will do the trick for you as well. Let me know.
from sbt-docker-compose.
Thanks for continue help but i am seeing the same error .
I have attached the completed console.log as well as the project again after the modification you mentioned.
Also below is the my environment
Centos 7
Docker Version
[spark@Mindstorm justbuyapi]$ docker version
Client:
Version: 17.03.0-ce
API version: 1.26
Go version: go1.7.5
Git commit: 60ccb22
Built: Thu Feb 23 10:54:03 2017
OS/Arch: linux/amd64
Server:
Version: 17.03.0-ce
API version: 1.26 (minimum version 1.12)
Go version: go1.7.5
Git commit: 60ccb22
Built: Thu Feb 23 10:54:03 2017
OS/Arch: linux/amd64
Experimental: false
Docker Compose Version
[spark@Mindstorm justbuyapi]$ docker-compose version
docker-compose version 1.8.1, build 878cff1
docker-py version: 1.10.5
CPython version: 2.7.5
OpenSSL version: OpenSSL 1.0.1e-fips 11 Feb 2013
from sbt-docker-compose.
Hi @ashishsoni,
I thought that you were only interested in running dockerComposeUp
from the sub-projects and not from the root
so I didn't try it from the root
project in the example you provided. When I do run it from the root
I noticed that you have a mistake in your docker-compose.yml
file.
image: frontendapi:<localBuild>
Needs to be defined as:
image: frontendapi:latest<localBuild>
Your image
definition for backendapi
was done correctly.
After making that change it worked correctly for me. Hopefully that does the trick for you as well! Let me know how it goes.
from sbt-docker-compose.
Totally My bad .
Thank you very much really appreciated your help. It is working now
from sbt-docker-compose.
Happy to hear that it's working now!
from sbt-docker-compose.
Related Issues (20)
- Plugin starts tests even if not all containers are ready. HOT 4
- useStaticPorts does not seems to take effect HOT 2
- -debug doesn't work with specs2 HOT 2
- How to link my scala app's container, created by sbt-native-packager, to the dependency containers? HOT 1
- dockerComposeTest does not remove Docker instances when the compliation fails HOT 7
- multi project build with sbt-native-packager HOT 2
- DockerComposeTest does not pick up FeatureSpecs HOT 3
- Specs2 tests that have a different constructor don't run
- dockerComposeTest returns success on compilation error
- Provide dockerComposeTestOnly HOT 1
- Question - where does sbt-docker-compose plugin live? HOT 2
- Exception for invalid volume definition
- Configurable 'instanceName' (-p project-name)
- Forthcoming Deprecation / Transfer of Ownership Notice HOT 2
- SBT 1.3.3 breaks sbt-docker-compose
- dockerComposeTest doesn't include parent test scope in dependency classpath
- "Could not parse image id" HOT 1
- Support docker-compose 2.x HOT 3
- Run specs2 tests in multi-project code? HOT 4
- SBT 1.1.0-M1 compatibility issues HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sbt-docker-compose.