Compare commits
6 Commits
23deb8c029
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| c07d6599fc | |||
| f112431351 | |||
| b066b8e767 | |||
| a16daac8e6 | |||
| 03ee674ea9 | |||
| 2e617f3f10 |
18
LICENSE
18
LICENSE
@@ -1,9 +1,9 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) <year> <copyright holders>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
MIT License
|
||||
|
||||
Copyright (c) <year> <copyright holders>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
84
README.md
84
README.md
@@ -2,6 +2,12 @@
|
||||
|
||||
## Setup
|
||||
|
||||
``` bash
|
||||
curl -fsSL https://get.docker.com -o get-docker.sh
|
||||
sh get-docker.sh
|
||||
docker run hello-world
|
||||
```
|
||||
|
||||
### Alphine
|
||||
source https://wiki.alpinelinux.org/wiki/Docker
|
||||
|
||||
@@ -10,12 +16,61 @@ apk add docker
|
||||
addgroup username docker
|
||||
rc-update add docker default
|
||||
service docker start
|
||||
```
|
||||
### fuse overlay
|
||||
|
||||
```bash
|
||||
apt install --yes fuse-overlayfs
|
||||
```
|
||||
|
||||
## Containers
|
||||
|
||||
### Containers list
|
||||
|
||||
```bash
|
||||
docker container list
|
||||
```
|
||||
|
||||
|
||||
### Interactive shell
|
||||
|
||||
```bash
|
||||
#example with ubuntu
|
||||
docker container run -it ubuntu /bin/bash
|
||||
```
|
||||
### Remove when finished
|
||||
|
||||
```bash
|
||||
#example with ubuntu
|
||||
docker container run -rm ubuntu
|
||||
```
|
||||
### Attach to a running container
|
||||
|
||||
```bash
|
||||
#attach to stdout of container with name ubuntu
|
||||
docker container run -a ubuntu
|
||||
## connects to container with name ubuntu and attach to bash (interactive)
|
||||
docker exec -it pm_wp_adminer /bin/bash
|
||||
```
|
||||
|
||||
## Volumes
|
||||
|
||||
### Export / Backup
|
||||
|
||||
```bash
|
||||
#export volumes (tar) from dbstore container into volume
|
||||
docker run --rm --volumes-from dbstore -v $(pwd):/backup ubuntu tar cvf /backup/backup.tar /dbdata
|
||||
```
|
||||
|
||||
|
||||
### Import / Restores
|
||||
|
||||
```bash
|
||||
#inports volumes (untar) into dbstore2
|
||||
docker run --rm --volumes-from dbstore2 -v $(pwd):/backup ubuntu bash -c "cd /dbdata && tar xvf /backup/backup.tar --strip 1"
|
||||
```
|
||||
|
||||
|
||||
### NFS
|
||||
|
||||
Notes:
|
||||
@@ -117,3 +172,32 @@ if network required between host and docker container on a macvlan docker networ
|
||||
post-up ip route add 192.168.1.250 dev macvlan_bridge
|
||||
post-up ip route add 192.168.1.248 dev macvlan_bridge
|
||||
```
|
||||
|
||||
## log
|
||||
|
||||
write to docker log buffer
|
||||
|
||||
``` bash
|
||||
echo "Hello World!" >> /proc/1/fd/1
|
||||
```
|
||||
|
||||
clear all docker logs
|
||||
|
||||
``` bash
|
||||
truncate -s 0 /var/lib/docker/containers/*/*-json.log;
|
||||
```
|
||||
|
||||
## delete all images
|
||||
|
||||
``` bash
|
||||
docker rmi -f $(docker images -aq)
|
||||
```
|
||||
|
||||
## delete all images
|
||||
|
||||
``` bash
|
||||
docker volume rm $(docker volume ls -qf dangling=true)
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
apt install --yes fuse-overlayfs
|
||||
curl -fsSL "https://get.docker.com" -o get-docker.sh
|
||||
#!/bin/bash
|
||||
apt install --yes fuse-overlayfs
|
||||
curl -fsSL "https://get.docker.com" -o get-docker.sh
|
||||
sh get-docker.sh
|
||||
Reference in New Issue
Block a user