Best practice for dockerfile maintain?

后端 未结 1 680
滥情空心
滥情空心 2021-01-06 12:30

I have a Dockerfile something like follows:

FROM openjdk:8u151

# others here

I have 2 questions about the base image:

1

相关标签:
1条回答
  • 2021-01-06 13:05

    How to get the tags?

    See "How to list all tags for a Docker image on a remote registry?".
    The API is enough

    For instance, visit:

    https://registry.hub.docker.com/v2/repositories/library/java/tags/?page_size=100&page=2

    Will the base image safe?

    As long as you save your own built image in a registry (eithe rpublic one, or a self-hosted one), yes: you will be able to at least build new images based on the one you have done.
    Or, even if the base image disappears, you still have its layers in your own image, and can re-tag it (provided the build cache is available).
    See for instance "Is there a way to tag a previous layer in a docker image or revert a commit?".
    See caveats in "can I run an intermediate layer of docker image?".

    0 讨论(0)
提交回复
热议问题