-
-
Save dnephin/0aa8e8962ebcdcebff1cec7315a224dd to your computer and use it in GitHub Desktop.
Show docker-compose down -v removes anonymous volumes from the Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '2' | |
services: | |
web: | |
build: . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM alpine:3.6 | |
RUN mkdir /foo | |
VOLUME /foo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ docker volume ls | |
DRIVER VOLUME NAME | |
$ docker-compose up -d | |
Building web | |
Step 1/3 : FROM alpine:3.6 | |
---> 7328f6f8b418 | |
Step 2/3 : RUN mkdir /foo | |
---> Running in eb658aaf06b8 | |
---> cd9da49cdafe | |
Removing intermediate container eb658aaf06b8 | |
Step 3/3 : VOLUME /foo | |
---> Running in 71008c613b97 | |
---> a644a350204b | |
Removing intermediate container 71008c613b97 | |
Successfully built a644a350204b | |
Successfully tagged tmp_web:latest | |
WARNING: Image for service web was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`. | |
Creating tmp_web_1 ... | |
Creating tmp_web_1 ... done | |
$ docker volume ls | |
DRIVER VOLUME NAME | |
local d699f740385d7656088fcfb9a4f3700dc8ecc555c7de616e06e24f25bb3aca38 | |
$ docker-compose -f /tmp/dc.yml down -v | |
Removing tmp_web_1 ... done | |
Removing network tmp_default | |
$ docker volume ls | |
DRIVER VOLUME NAME | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment