Coder Social home page Coder Social logo

simple-docker-volume's Introduction

simple-docker-volume

check apple volume capability

$ docker container prune
WARNING! This will remove all stopped containers.
Are you sure you want to continue? [y/N] y
Deleted Containers:
c5d9279a43f5cf476296ba86f8447bdc15962201657bce7d62962930276673f2 Total reclaimed space: 0B

$ docker volume prune
WARNING! This will remove all local volumes not used by at least one container. Are you sure you want to continue? [y/N] y Deleted Volumes: 0b9743c738828725bab18dfeff4c803e82d340410ace154e898a2339986d4039 Total reclaimed space: 19B

$ ./build-image.sh
→ Delete dangling images WARNING! This will remove all dangling images. Are you sure you want to continue? [y/N] y Total reclaimed space: 0B → Delete dangling images - alternative "docker rmi" requires at least 1 argument. See 'docker rmi --help'. Usage: docker rmi [OPTIONS] IMAGE [IMAGE...]

Remove one or more images → Build an image from a Dockerfile Sending build context to Docker daemon 72.19kB Step 1/4 : FROM ubuntu ---> f643c72bc252 Step 2/4 : RUN mkdir /simple-vol-dir ---> Using cache ---> 83a50c4e48ae Step 3/4 : RUN echo "Simple Volume" > /simple-vol-dir/simple-volume ---> Running in da086e91e4fb Removing intermediate container da086e91e4fb ---> 2313266c762f Step 4/4 : VOLUME /simple-vol-dir ---> Running in 72c4911348e8 Removing intermediate container 72c4911348e8 ---> 93e2cf6dd1eb Successfully built 93e2cf6dd1eb Successfully tagged simple-volume-image:latest → Container-Run

$ docker volume ls
DRIVER VOLUME NAME
local 603f90027eaf66e6b7cc853e65f63346f15dabb834fa2aaadf771e236a7f28d1

$ docker volume inspect 603f90027eaf66e6b7cc853e65f63346f15dabb834fa2aaadf771e236a7f28d1 [ { "CreatedAt": "2020-12-28T15:39:29+01:00", "Driver": "local", "Labels": null, "Mountpoint": "/var/lib/docker/volumes/603f90027eaf66e6b7cc853e65f63346f15dabb834fa2aaadf771e236a7f28d1/_data", "Name": "603f90027eaf66e6b7cc853e65f63346f15dabb834fa2aaadf771e236a7f28d1", "Options": null, "Scope": "local" } ]

$ sudo ls -l /var/lib/docker/volumes/603f90027eaf66e6b7cc853e65f63346f15dabb834fa2aaadf771e236a7f28d1/_data total 4 -rw-r--r-- 1 root root 14 Dec 28 15:39 simple-volume

$ sudo ls -l /var/lib/docker/volumes/603f90027eaf66e6b7cc853e65f63346f15dabb834fa2aaadf771e236a7f28d1/_data/simple-volume -rw-r--r-- 1 root root 14 Dec 28 15:39 /var/lib/docker/volumes/603f90027eaf66e6b7cc853e65f63346f15dabb834fa2aaadf771e236a7f28d1/_data/simple-volume

$ sudo cat /var/lib/docker/volumes/603f90027eaf66e6b7cc853e65f63346f15dabb834fa2aaadf771e236a7f28d1/_data/simple-volume Simple Volume

Mac OS

macOS is NOT a native host of the Docker engine,
which is why the Docker engine
runs through a Linux virtual machine (VM).
The path specified in a Docker volume
is a path on the virtual machine’s filesystem.
Acces can be gained for example
by setting this alias in the shell's configuration file:

alias dvmc='docker run -it --rm --privileged --pid=host alpine:edge nsenter -t 1 -m -u -n -i sh

Once the docker run ... command has been run
access can be gained to the docker managed data
by executing the alias:

$ dvmc

simple-docker-volume's People

Contributors

ewanewart avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.