-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate from ubuntu to alpine:3.6 #5
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should not be commented in example.
./docker_volume_backup.sh /home/kiview/Gitlab/docker-compose.yml gitlab $(pwd)/backup restore 2016-10-19 | ||
``` | ||
|
||
### docker_full_backup.sh | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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=() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove commented code.
echo " volumes are excluded" | ||
else | ||
echo " mounting volumes and performing backup/restore..." | ||
#declare -a volumes=() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove commented code.
volumes=($(docker volume ls -f name=$project_name | awk '{if (NR > 1) print $2}')) | ||
for v in "${volumes[@]}" | ||
do | ||
#declare -a volumes=() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove commented code.
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-data
after the fix