Git Product home page Git Product logo

Comments (3)

greenled avatar greenled commented on June 30, 2024 1

Hi @kaotika

I'm glad you liked this tool. The error you are getting happens when you neither mark a config as external (external: true) or specify a file to load it from (file: index.html). It will happen both in Portainer and in docker stack deploy command.

According to the Compose file version 3 reference "The source of the config is either file or external". Portainer only supports external configs, as it only accepts the stack file content and no additional files to load the configs from. You have to create the config first, then deploy/update the stack and reference the config as external (external: true). So far, only the latest can be done through this tool so, you will have to create the config in Portainer by hand.

As you noted, the latest release (0.1.1) is a bit outdated, but it's still the most stable one and the recommended for production environments. In that version you could achieve the same result with:

./psu -a deploy -l https://docker.local.com -u USER -p PASSWORD -n test -c stack.1.yml

The version in master branch has it's advantages, like zero external dependencies and a simpler sintax, but it's still unreleased and it's API is likely to suffer changes.

Nevertheles, this issue brings to light an interesting use case where one would want to deploy stacks with file configs in Portainer (in a single step), just like you would do with docker stack deploy command. It could be a nice addition to this project. From Portainer API docs:

Portainer DO NOT expose specific endpoints to manage your Docker resources (create a container, remove a volume, etc...).

Instead, it acts as a reverse-proxy to the Docker HTTP API. This means that you can execute Docker requests via the Portainer HTTP API.

from portainer-stack-utils.

kaotika avatar kaotika commented on June 30, 2024

Thanks for quick answer.
Seems I really missed the external: false flag...my fault.

Are their any plans to support config/secret creation? If so I vote for it. 👍

from portainer-stack-utils.

greenled avatar greenled commented on June 30, 2024

There could be. Would you help me shape the idea? Like how would it look like, how would you use it, how does it work with similar tools, are there corner cases, a single file o several ones, which format...? Please fill a new issue with this info. I'm closing this one.

from portainer-stack-utils.

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.