SamTV12345/PodFetch

Tag docker image with version

Closed this issue · 3 comments

Clear and concise description of the problem

Docker registry only have 4 tagged version au PodFetch :

  • dev
  • latest
  • postgres
  • dev-postgres

Which is fine for people using Watchtower for example.

But it would also be good to tag Docker images with the version tagged (ex: samuel19982/podfetch:4.2.2).

(The reason for this, is "latest" will do things behind the scene that might be irreverisble, when, for example, restoring a backup, or duplicating servers).

Suggested solution

In addition to already existing tags, taggin Docker images with the version tagged (ex: samuel19982/podfetch:4.2.2).

Alternative

No response

Additional context

No response

Validations

Hi thanks for creating the issue with this extensive documentation. Do you have experience with implementing that in Jenkins?

Hello, I never used Jenkins, but first result in a search engine provided an example for how to do it (you might want to replace ${env.BUILD_NUMBER} with something like $tag_name) :

stage('Push image') {
    docker.withRegistry('https://registry.hub.docker.com', 'docker-hub-credentials') {
        app.push("${env.BUILD_NUMBER}")
        app.push("latest")
    }
}

(source : https://stackoverflow.com/a/53858257/4380515)

Hello, I never used Jenkins, but first result in a search engine provided an example for how to do it (you might want to replace ${env.BUILD_NUMBER} with something like $tag_name) :

stage('Push image') {
    docker.withRegistry('https://registry.hub.docker.com', 'docker-hub-credentials') {
        app.push("${env.BUILD_NUMBER}")
        app.push("latest")
    }
}

(source : https://stackoverflow.com/a/53858257/4380515)

Thanks. I found an even better way with git tag and git commit id.