Coder Social home page Coder Social logo

Comments (10)

kurtkopchik avatar kurtkopchik commented on June 23, 2024

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.

ashishsoni avatar ashishsoni commented on June 23, 2024

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.

docker-compose.txt

from sbt-docker-compose.

kurtkopchik avatar kurtkopchik commented on June 23, 2024

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.

ashishsoni avatar ashishsoni commented on June 23, 2024

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.

ashishsoni avatar ashishsoni commented on June 23, 2024

I have attached the whole project , Please try
justbuyapi.tar.gz

from sbt-docker-compose.

kurtkopchik avatar kurtkopchik commented on June 23, 2024

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.

ashishsoni avatar ashishsoni commented on June 23, 2024

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

justbuyapi.tar.gz

console.txt

from sbt-docker-compose.

kurtkopchik avatar kurtkopchik commented on June 23, 2024

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.

ashishsoni avatar ashishsoni commented on June 23, 2024

Totally My bad .
Thank you very much really appreciated your help. It is working now

from sbt-docker-compose.

kurtkopchik avatar kurtkopchik commented on June 23, 2024

Happy to hear that it's working now!

from sbt-docker-compose.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.