Storage tmpfs
Last updated
Last updated
$ docker container run -it \
--mount type=tmpfs,target=/app \
ubuntu \
/bin/bash
Unable to find image 'ubuntu:latest' locally
latest: Pulling from library/ubuntu
31e907dcc94a: Already exists
Digest: sha256:8a37d68f4f73ebf3d4efafbcf66379bf3728902a8038616808f04e34a9ab63ee
Status: Downloaded newer image for ubuntu:latest
root@2fec593dfdcd:/# ls
app boot etc lib media opt root sbin sys usr
bin dev home lib64 mnt proc run srv tmp var
root@2fec593dfdcd:/# cd app
root@2fec593dfdcd:/app# ls
root@2fec593dfdcd:/app# touch teste1.txt
root@2fec593dfdcd:/app# ls
teste1.txt
root@2fec593dfdcd:/app# exit
exit
$ docker volume ls
DRIVER VOLUME NAME
$$ docker container run -d -p 3306:3306 \
--tmpfs /var/lib/mysql -e MYSQL_ROOT_PASSWORD=123456 \
mysql
Unable to find image 'mysql:latest' locally
latest: Pulling from library/mysql
6e839ac3722d: Pull complete
ad912193ad5f: Pull complete
25d13d87fd8d: Pull complete
004d383c75ef: Pull complete
6d9bbc82a0b8: Pull complete
81fec07ea550: Pull complete
83357cb2d3a5: Pull complete
8ffe968b82c1: Pull complete
30dfd9a7ed57: Pull complete
35844ae33cbe: Pull complete$ docker container ls
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
b98bf135be30 mysql "docker-entrypoint.s…" 12 minutes ago Up 12 minutes 0.0.0.0:3306->3306/tcp, :::3306->3306/tcp, 33060/tcp nostalgic_vaughan
marcelo@Latitude5440:~$ docker container rm -f b98b
b98b