Set tag / pass docker args to remote build
-
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. -
@stantropics Can you clarify what you mean by
docker build
generates a tag by itself? Do you mean thelatest
tag? You can tag the image however you want usingdocker build -t image:tag
no? -
@girish I have totally failed in describing my issue, sorry.
I am not talking aboutdocker build
but aboutcloudron 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:- 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 - 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. - One cannot pass the build-service url when using
-
@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)
- You can then pass
-
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.