Docker Community Forums

Share and learn in the Docker community.

How to set validity for docker image for certain days using Dockerfile

HI,

I have decided to create docker container from docker image for only certain days than later my container should get expired immediately.
Moreover nobody should try to create container from that same image after
expiry of time.
Could anyone help this… how to achieve this task…

Image should valid for only certain days.

Please discard below steps.

  1. Using sleep while creating docker run cmd
  2. Adding script inside of container from dockerfile to stop.