First big articles reformatting now that I properly understand hugo
This commit is contained in:
parent
5e6844592a
commit
1a4981a826
40 changed files with 184 additions and 173 deletions
|
@ -1,5 +0,0 @@
|
|||
---
|
||||
title: "Docker"
|
||||
linkTitle: "Docker"
|
||||
weight: 40
|
||||
---
|
|
@ -1,12 +1,15 @@
|
|||
---
|
||||
title: "Cleaning a docker host"
|
||||
linkTitle: "Cleaning a docker host"
|
||||
date: 2018-01-29
|
||||
description: >
|
||||
How to retrieve storage space by cleaning a docker host
|
||||
description: How to retrieve storage space by cleaning a docker host
|
||||
tags:
|
||||
- docker
|
||||
- linux
|
||||
---
|
||||
|
||||
Be carefull that this will delete any stopped container and remove any locally unused image and tags :
|
||||
## The command
|
||||
|
||||
Be careful that this will delete any stopped container and remove any locally unused images, volumes and tags :
|
||||
{{< highlight sh >}}
|
||||
docker system prune -f -a
|
||||
{{< /highlight >}}
|
||||
|
|
|
@ -1,14 +1,19 @@
|
|||
---
|
||||
title: "Docker compose predictable bridge"
|
||||
linkTitle: "Docker compose predictable bridge"
|
||||
date: 2018-09-25
|
||||
description: >
|
||||
How to use a predefined bridge with docker compose
|
||||
description: How to use a predefined bridge with docker compose
|
||||
tags:
|
||||
- docker
|
||||
- linux
|
||||
---
|
||||
|
||||
## The problem
|
||||
|
||||
By default, docker-compose will create a network with a randomly named bridge. If you are like me using a strict firewall on all your machines, this just cannot work.
|
||||
|
||||
You need to put your services in `network_mode: “bridge”` and add a custom `network` entry like :
|
||||
## The fix
|
||||
|
||||
For example if your bridge is named docbr1, you need to put your services in `network_mode: “bridge”` and add a custom `network` entry like :
|
||||
|
||||
{{< highlight yaml >}}
|
||||
version: '3.0'
|
||||
|
@ -27,5 +32,5 @@ services:
|
|||
networks:
|
||||
default:
|
||||
external:
|
||||
name: bridge
|
||||
name: docbr1
|
||||
{{< /highlight >}}
|
||||
|
|
|
@ -1,12 +1,15 @@
|
|||
---
|
||||
title: "Migrate a data volume"
|
||||
linkTitle: "Migrate a data volume"
|
||||
date: 2018-01-30
|
||||
description: >
|
||||
How to migrate a data volume
|
||||
description: How to migrate a data volume between two hosts
|
||||
tags:
|
||||
- docker
|
||||
- linux
|
||||
---
|
||||
|
||||
Here is how to migrate a data volume between two of your hosts. A rsync of the proper `/var/lib/docker/volumes` subfolder would work just as well, but is here a fun way to do it with docker and pipes :
|
||||
## The command
|
||||
|
||||
Here is how to migrate a data volume between two of your hosts. A rsync of the proper `/var/lib/docker/volumes` subfolder would work just as well, but here is a fun way to do it with docker and pipes :
|
||||
{{< highlight sh >}}
|
||||
export VOLUME=tiddlywiki
|
||||
export DEST=10.1.0.242
|
||||
|
|
|
@ -1,12 +1,19 @@
|
|||
---
|
||||
title: "Shell usage in dockerfile"
|
||||
linkTitle: "Shell usage in dockerfile"
|
||||
date: 2019-02-04
|
||||
description: >
|
||||
How to use a proper shell in a dockerfile
|
||||
description: How to use a proper shell in a dockerfile
|
||||
tags:
|
||||
- docker
|
||||
- linux
|
||||
---
|
||||
|
||||
The default shell is `[“/bin/sh”, “-c”]`, which doesn't handle pipe fails when chaining commands. To process errors when using pipes use this :
|
||||
## The problem
|
||||
|
||||
The default shell is `[“/bin/sh”, “-c”]`, which doesn't handle pipe fails when chaining commands.
|
||||
|
||||
## The fix
|
||||
|
||||
To process errors when using pipes use this :
|
||||
|
||||
{{< highlight sh >}}
|
||||
SHELL ["/bin/bash", "-eux", "-o", "pipefail", "-c"]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue