#What is the best way to publish and save image at the same time

1 messages · Page 1 of 1 (latest)

rancid sierra
#

I've some experiment with the https://github.com/wingyplus/kaogeek-discord-bot that's forked from https://github.com/creatorsgarten/kaogeek-discord-bot. My goal is trying to replace the Dockerfile defined in https://github.com/creatorsgarten/kaogeek-discord-bot/blob/main/Dockerfile. But the problem that I quite stuck here is:

  1. I develop on local machine, I need to save image to check the details in the image. The current workflow is I need to call export api to export the tarball file, load the image and then tagging it with docker. The question is how do I combine those steps into single step for developer convenience.
  2. How to design the program to do publish and export the image at the same time? Currently, I've thought about the program must have something like env var, flag or argument to tell the program to publish or export the image or calling it both.

How do you solve those problems above?

In case you need to see the pipeline. It's here https://github.com/wingyplus/kaogeek-discord-bot/blob/dagger/deployment/deployment.mts

Thank you.

GitHub

Discord bot for KaoGeek, built with TypeScript. Contribute to wingyplus/kaogeek-discord-bot development by creating an account on GitHub.

GitHub

Discord bot for KaoGeek, built with TypeScript. Contribute to wingyplus/kaogeek-discord-bot development by creating an account on GitHub.

visual fox
# rancid sierra I've some experiment with the https://github.com/wingyplus/kaogeek-discord-bot t...

👋

for #1 there's no dagger native way of doing this. One alternative to provide a solution to this is to either use the nodejs docker cli (https://github.com/Quobject/docker-cli-js) and do the load and tag from your code, or use exec directly from your code to perform this so it can be done withing the same pipeline. That's the "power" of having a programming language.

Re #2, yes, using a flag would be a good approach.

GitHub

A node.js wrapper for the docker command line tool - GitHub - Quobject/docker-cli-js: A node.js wrapper for the docker command line tool