Coder Social home page Coder Social logo

Comments (2)

kurtkopchik avatar kurtkopchik commented on June 23, 2024

Hi @ches, thanks for the detailed write-up!

There are two settings you should be aware of:

  1. There is a skipPull argument you can pass to dockerComposeUp that will result in only local images being used for all images instead of pulling from the registry. This also is useful for the scenario you describe in #80 where you are on an airplane, or do not have an internet connection, and you do not want to attempt to connect to the docker registry when starting the compose instance.

dockerComposeUp skipPull

  1. To determine which docker compose service is being built by the current sbt project the plugin attempts to find a docker-compose.yml service name that matches the sbt project name. If it finds a match then it considers that image to be built by the current project and it will not attempt to pull it from the registry. Looking at your project above I'm guessing that your sbt project name is different than my-app therefore the plugin does not know that it should bypass the pulling of this image.

The composeServiceName setting can be used to explicitly define what service name in the docker-compose.yml file should be mapped to the project as the one being built locally if the name differs from that of the sbt project.
composeServiceName := // Specify the name of the service in the Docker Compose file being tested. This setting prevents the service image from being pull down from the Docker Registry. It defaults to the sbt Project name.

Let me know if that fixes the issue you are seeing. If not, a reproduction of the project would be very helpful as what you are attempting to do should work.

from sbt-docker-compose.

ches avatar ches commented on June 23, 2024

The composeServiceName setting can be used to explicitly define what service name in the docker-compose.yml file should be mapped to the project as the one being built locally if the name differs from that of the sbt project.

Ahhh this is the ticket! I completely overlooked the existence of that setting and hadn't come across the logic yet, my apologies. Indeed the Compose service name and Docker image name are simplified from the project name so this was precisely the issue. A second catch was that sbt/sbt-native-packager#947 was causing packageName in Docker to not result in the expected image name when built, upgrading to the latest milestone cleared that up. Now everything is clicking.

And you're right that dockerComposeUp skipPull should address the "airplane" scenario, I'd misunderstood it on first reading.

Thanks again for your quick and helpful responses.

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.