Migrate from ubuntu to alpine:3.6#5
Conversation
|
add a extended script docker_full_backup.sh for an full backup. For an fast and safe restore the containers should also saved.
|
|
so, all things should work fine. Please let my know if you found something :) |
|
Cool, thanks :) |
| RUN apk add py-pip | ||
| RUN apk add bash | ||
| RUN apk add gzip | ||
| RUN rm -rf /var/cache/apk/* |
There was a problem hiding this comment.
We should squash these layers into a single layer (so only one RUN statement). I know it wasn't done in the original version, but that's how it should be done ;)
| BACKUP_DIR=/tmp/mybackups | ||
| DATE=xxxx-xx-xx | ||
|
|
||
| #export EXCLUDE_CONTAINER=1 |
There was a problem hiding this comment.
Should not be commented in example.
| ``` | ||
|
|
||
| ### docker_full_backup.sh | ||
|
|
There was a problem hiding this comment.
Missing introductory text which explains, that the following code should reside in its own bash script.
| you can use it like this: | ||
|
|
||
| ```bash | ||
| PROJECT_DIR # path to directory that contains the docker files, e.g. docker-compose.yml, Dockerfile, ... |
There was a problem hiding this comment.
Same as above, this will only work if the example is in a bash file. The old examples could be run directly from the command line.
| echo " container are excluded" | ||
| else | ||
| echo " enter container images" | ||
| #declare -a containers=() |
| echo " volumes are excluded" | ||
| else | ||
| echo " mounting volumes and performing backup/restore..." | ||
| #declare -a volumes=() |
| volumes=($(docker volume ls -f name=$project_name | awk '{if (NR > 1) print $2}')) | ||
| for v in "${volumes[@]}" | ||
| do | ||
| #declare -a volumes=() |
|
Would it be possible to have two different PRs? The first one for switching to alpine and another for adding the full backup functionality? And since a lot of code of Also please explain to me the use case of |
|
sorry, I'm very busy. I will fix and explain that in a week. |
request was started at #4
add bug fix for line
volumes=($(docker volume ls -f name=$project_name | awk '{if (NR > 1) print $2}'))the output of an container with two volumes was
but there are two volumes
# docker volume ls -f name=nextcloud | awk '{if (NR > 0) print $2}' VOLUME nextcloud_nextcloud-postgres-data nextcloud_postgres-dataafter the fix