Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    Solved Set tag / pass docker args to remote build

    Build Service
    2
    6
    358
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      stantropics last edited by

      Hi everyone,
      I am trying to build remotely using the build services which works perfectly. However, docker build generates a tag by itself. How can I make it use a predefined tag?

      Any help is apreciated.
      Thanks a lot in advance. 🙂

      girish 1 Reply Last reply Reply Quote 0
      • girish
        girish Staff @stantropics last edited by

        @stantropics Can you clarify what you mean by docker build generates a tag by itself? Do you mean the latest tag? You can tag the image however you want using docker build -t image:tag no?

        1 Reply Last reply Reply Quote 0
        • girish
          girish Staff last edited by

          Also, you ask about passing args. You can pass args like cloudron build --build-arg MAXMIND_LICENSE_KEY=somekey for example. This is the same as docker build --build-arg but works with the build service.

          S 1 Reply Last reply Reply Quote 1
          • S
            stantropics @girish last edited by stantropics

            @girish I have totally failed in describing my issue, sorry. 😁
            I am not talking about docker buildbut about cloudron build. It works perfectly when you follow the documentation. However, I am currently working on setting up a drone CI pipeline for a custom app. While doing this I have two issues:

            1. One cannot pass the build-service url when using --set-build-service(like --set-build-service mybuild.service.com) It is not simple to answer the promt in the CI
            2. I cannot find a way to set a fixed tag like "latest" or "0.1.0". As you can see in the documentation cloudron build sets "20191113-015207-340e7f520" as the tag automatically.

            Hope it becomes clearer now. 🙂
            Unfortunately I was not able to solve this by myself yet - so if someone has a hint for me I would be happy.

            girish 1 Reply Last reply Reply Quote 0
            • girish
              girish Staff @stantropics last edited by girish

              @stantropics ah, understood now! I released a new CLI version that should solve both your issues. npm install -g cloudron@4.12.0 .

              • You can then pass --set-build-service mybuild.service.com . A token is also needed for authentication. So --build-service-token <token> . Currently, there is no UI to get this token, but it's in the /app/data/tokendb.json file of the build service.
              • You can now pass --tag 0.1.0 (important: only the tag without the repo name. repo name is set with --set-repository as before)
              S 1 Reply Last reply Reply Quote 2
              • S
                stantropics @girish last edited by

                Just tried it and a cloudron build --set-build-service mybuild.service.com --build-service-token <token-from-/app/data/tokendb.json> --set-repository <your.docker.registry>/<appname> --tag latest now starts the build and pushes it to the repo. Thanks a thousand times, @girish. This is awesome.

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post
                Powered by NodeBB