beginners/volume/Changing-Data-in-Volumes.md
Pull down alpine docker image
Add content to volume in Dockerfile
Verify the content by running the container
Pull a lightweight alpine distribution image.
docker pull alpine
Create a Dockerfile with alpine image as base and write data into myvol
FROM alpine
RUN mkdir /myvol
RUN echo 'Hello! Welcome to Docker Community' >> /myvol/greeting
VOLUME /myvol
Build the Docker Image:
docker build -t volume_image .
Verify the data by starting the container and displaying the content of the file
$ docker run -it volume_image cat /myvol/greeting
Hello! Welcome to Docker Community
docker rm -f $(docker ps -aq) .
docker rmi $(docker images -q)
docker volume rm $(docker volume ls -q)