How to force Docker for a clean build of an image

后端 未结 9 936
情书的邮戳
情书的邮戳 2021-01-29 17:12

I have build a Docker image from a Docker file using the below command.

$ docker build -t u12_core -f u12_core .

When I am trying to rebuild it

9条回答
  •  迷失自我
    2021-01-29 17:46

    In some extreme cases, your only way around recurring build failures is by running:

    docker system prune
    

    The command will ask you for your confirmation:

    WARNING! This will remove:
        - all stopped containers
        - all volumes not used by at least one container
        - all networks not used by at least one container
        - all images without at least one container associated to them
    Are you sure you want to continue? [y/N]
    

    This is of course not a direct answer to the question, but might save some lives... It did save mine.

提交回复
热议问题