1
0
Fork 0
Signed-off-by: Arnaud Morin <arnaud.morin@ovhcloud.com>
This commit is contained in:
Arnaud Morin 2022-01-08 23:36:33 +01:00
parent 4b7cfe91f6
commit c23bd6a041
2 changed files with 11 additions and 0 deletions

View File

@ -50,6 +50,7 @@ wget https://www.arnaudmorin.fr/tmux.conf -O /root/.tmux.conf
wget https://www.arnaudmorin.fr/plikrc -O /root/.plikrc wget https://www.arnaudmorin.fr/plikrc -O /root/.plikrc
wget https://www.arnaudmorin.fr/plik -O /usr/local/bin/plik wget https://www.arnaudmorin.fr/plik -O /usr/local/bin/plik
chmod +x /usr/local/bin/plik chmod +x /usr/local/bin/plik
echo 'if [[ -n "$PS1" ]] && [[ -z "$TMUX" ]] && [[ -n "$SSH_CONNECTION" ]]; then tmux new-session -A -s ssh_tmux ;fi' >> /root/.bashrc
title.print "Install docker" title.print "Install docker"

View File

@ -20,6 +20,8 @@ List the images
``` ```
docker images docker images
```
```
... ...
debian latest 6f4986d78878 2 weeks ago 124MB debian latest 6f4986d78878 2 weeks ago 124MB
... ...
@ -48,6 +50,8 @@ Ok, now it's time to see the `docker ps` command.
The `docker ps` command shows you all containers that are currently running: The `docker ps` command shows you all containers that are currently running:
``` ```
docker ps docker ps
```
```
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f9c03ce13b09 demo "/usr/sbin/sshd -D" 32 minutes ago Up 32 minutes 127.0.0.2:8080->8080/tcp, 127.0.0.2:2222->22/tcp demo f9c03ce13b09 demo "/usr/sbin/sshd -D" 32 minutes ago Up 32 minutes 127.0.0.2:8080->8080/tcp, 127.0.0.2:2222->22/tcp demo
``` ```
@ -61,15 +65,21 @@ You're probably wondering if there is a way to run more than just one command in
``` ```
docker run -it debian bash docker run -it debian bash
```
```
/ # ls / # ls
bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var
``` ```
Running the `run` command with the `-it` flags attaches us to an interactive tty in the container. Now we can run as many commands in the container as we want. Take some time to run your favorite commands. Running the `run` command with the `-it` flags attaches us to an interactive tty in the container. Now we can run as many commands in the container as we want. Take some time to run your favorite commands.
To exit from the container, just type `exit`
It's now time to clean some of the old stopped containers to avoid filling your system with dead containers: It's now time to clean some of the old stopped containers to avoid filling your system with dead containers:
``` ```
docker ps -a docker ps -a
```
```
# grab the ID of the containers you want to clean # grab the ID of the containers you want to clean
docker rm xxyy docker rm xxyy
``` ```