Cannot delete files from wwwroot with Dockerfile

I’m trying this on Windows Server Core 2016 TP5. I have this simple Dockerfile:

FROM microsoft/iis

RUN powershell remove-item c:\inetpub\wwwroot\iisstart.*

The microsoft/iis image contains a couple of files (iisstart.htm and iisstart.png) in c:\inetpub\wwwroot. I’m trying to remove those files.

  • What is the best way to get (stream) data from BigQuery to R (Rstudio server in Docker)
  • Docker : multiples linked containers for each customers
  • vuejs application does not run with dockerized npm
  • Remote debugging running process inside docker container
  • Can't Configure Remote Access of Docker Host
  • Running Ruby Sinatra inside a Docker container not able to connect (via Mac host) or find commands (in different scenario)?
  • Here’s the output from docker build:

    c:\git\temp\test>docker build -t foo .
    Sending build context to Docker daemon 2.048 kB
    Step 1 : FROM microsoft/iis
     ---> c26f4ceb81db
    Step 2 : RUN powershell remove-item c:\inetpub\wwwroot\iisstart.*
     ---> Running in 4d17a5ab86e5
     ---> d5f85251b3db
    Removing intermediate container 4d17a5ab86e5
    Successfully built d5f85251b3db

    If I now start up a container and look in wwwroot, the files are still there.

    docker run --rm -it foo cmd

    Microsoft Windows [Version 10.0.14300]
    (c) 2016 Microsoft Corporation. All rights reserved.
    C:\>cd inetpub\wwwroot
     Volume in drive C has no label.
     Volume Serial Number is 5664-BDCB
     Directory of C:\inetpub\wwwroot
    05/19/2016  07:05 PM    <DIR>          .
    05/19/2016  07:05 PM    <DIR>          ..
    05/05/2016  03:27 PM               703 iisstart.htm
    05/05/2016  03:27 PM            99,710 iisstart.png
                   2 File(s)        100,413 bytes
                   2 Dir(s)  21,209,399,296 bytes free

    While inside the running container, if I execute powershell remove-item c:\inetpub\wwwroot\iisstart.*, the files get deleted fine. Why doesn’t the same command work in the dockerfile?

    I’ve also tried del c:\inetpub\wwwroot\iisstart.* with similar results.

  • What is the need for Docker Daemon?
  • docker-compose cannot understand my env_file
  • Golang Dockerfile Failing
  • Docker read-only socket volume
  • bundling source code in docker containers
  • Spotify docker maven build multiple images
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.