skip to Main Content

One of our X employee has created an docker image. Currently i need to update the same image which was created by him. But unfortunately i couldn’t find the Dockerfile for the image.

Is it possible to generate a dockerfile from an image?

2

Answers


  1. this answer is good from here

    This worked for me from the answers

    docker pull chenzj/dfimage
    
    alias dfimage="docker run -v /var/run/docker.sock:/var/run/docker.sock --rm chenzj/dfimage"
    
    dfimage image_id
    

    you need the image id – not the name

    e.g

    $docker images
    
    REPOSITORY   TAG  IMAGE ID  CREATED  SIZE
    

    so the third column.

    There is still work to do with it and it all depends how the docker image was created

    Login or Signup to reply.
  2. You can try running this command:

    alias dfimage="docker run -v /var/run/docker.sock:/var/run/docker.sock --rm alpine/dfimage"
    dfimage -sV=1.36 IMAGE_NAME:IMAGE_TAG
    

    And note at Dockerfile

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search