frekele / helicopterizer Goto Github PK
View Code? Open in Web Editor NEWBackup and Restore for Docker Container!
Home Page: https://helicopterizer.frekele.org
License: MIT License
Backup and Restore for Docker Container!
Home Page: https://helicopterizer.frekele.org
License: MIT License
Assuming AWS_S3_BUCKET_NAME
is something like s3://my-bucket
, then bucketS3Uri=s3://s3://my-bucket
:
local bucketS3Uri="s3://$AWS_S3_BUCKET_NAME"
(https://github.com/frekele/helicopterizer/blob/master/scripts/core/helper.sh#L198)
This should be:
local bucketName=$(removeS3Prefix $AWS_S3_BUCKET_NAME)
I will make a PR when I can.
Here is the place to show your appreciation.
Cheers!
Disclaimer: I don't have any kind of connexion with the maintainer of this project. Pure gratitude here :)
Add support for crontab scheduler.
Upgrade Docker Engine to stable 1.12.5
Add support for encrypt openssl backup files.
More security for transport over the Internet.
Encrypt and decrypt:
# openssl aes-128-cbc -salt -in file -out file.aes
# openssl aes-128-cbc -d -salt -in file.aes -out file
Note that the file can of course be a tar archive.
tar and encrypt a whole directory
# tar -cf - directory | openssl aes-128-cbc -salt -out directory.tar.aes # Encrypt
# openssl aes-128-cbc -d -salt -in directory.tar.aes | tar -x -f - # Decrypt
tar zip and encrypt a whole directory
# tar -zcf - directory | openssl aes-128-cbc -salt -out directory.tar.gz.aes # Encrypt
# openssl aes-128-cbc -d -salt -in directory.tar.gz.aes | tar -xz -f - # Decrypt
Use -k mysecretpassword after aes-128-cbc to avoid the interactive password request. However note that this is highly insecure.
Use aes-256-cbc instead of aes-128-cbc to get even stronger encryption. This uses also more CPU.
Starting to clone
Cloning into '.'...
Cloning done
Starting Build
KernelVersion: 3.13.0-40-generic
Os: linux
BuildTime: 2016-02-22T21:37:01.910365059+00:00
ApiVersion: 1.22
Version: 1.10.2
GitCommit: c3959b1
Arch: amd64
GoVersion: go1.5.3
Starting build of index.docker.io/frekele/helicopterizer:master...
Step 1 : FROM alpine:3.3
---> d7a513a663c1
Step 2 : MAINTAINER frekele <[email protected]>
---> Running in 774ffaeedc1b
---> 6513092cf86b
Removing intermediate container 774ffaeedc1b
Step 3 : RUN echo "http://dl-6.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories && apk update && apk add bash curl wget git python py-pip docker && pip install --upgrade pip && pip install awscli
---> Running in a64b2b59c14f
fetch http://dl-cdn.alpinelinux.org/alpine/v3.3/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.3/community/x86_64/APKINDEX.tar.gz
fetch http://dl-6.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz
v3.3.3-28-gef388c9 [http://dl-cdn.alpinelinux.org/alpine/v3.3/main]
v3.3.3-9-gfc38db2 [http://dl-cdn.alpinelinux.org/alpine/v3.3/community]
v160223-1279-g59d3088 [http://dl-6.alpinelinux.org/alpine/edge/community]
OK: 6491 distinct packages available
ERROR: unsatisfiable constraints:
so:libseccomp.so.2 (missing):
required by:
docker-1.11.0-r1[so:libseccomp.so.2]
Removing intermediate container a64b2b59c14f
The command '/bin/sh -c echo "http://dl-6.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories && apk update && apk add bash curl wget git python py-pip docker && pip install --upgrade pip && pip install awscli' returned a non-zero code: 2
The descriptions on the README for the options GZIP_COMPRESSION
and CLEAN_DATA_BEFORE_RESTORE
are the same.
I imagine that this is not intentional, as the description "Boolean to indicate the compression of the file .tar to .tar.gz" make more sense for GZIP_COMPRESSION
rather than CLEAN_DATA_BEFORE_RESTORE
.
Add support for external backup volume.
Use Docker for backup and restoration of external volumes on the host with socket.
-v /var/run/docker.sock:/var/run/docker.sock
Currently you have to set the version while restoring. That causes you have to go to s3 and check the name of the last version. It will be great if by default it downloads the latest version
Great tool btw :)
Build Fail, After Upgrade to Alpine 3.5
FROM alpine:3.5
Error in command:
RUN apk add --update --no-cache \
bash \
curl \
wget \
git \
python\
py-pip \
docker \
&& curl -sL https://get.docker.com/builds/Linux/x86_64/docker-1.12.5 > /usr/bin/docker \
&& chmod +x /usr/bin/docker \
&& pip install --upgrade pip \
&& pip install awscli
Log error:
Build failed: The command '/bin/sh -c apk add --update --no-cache bash curl wget git python py-pip docker && curl -sL https://get.docker.com/builds/Linux/x86_64/docker-1.12.5 > /usr/bin/docker && chmod +x /usr/bin/docker && pip install --upgrade pip && pip install awscli' returned a non-zero code: 1
.....
fetch http://dl-cdn.alpinelinux.org/alpine/v3.5/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.5/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.5/community/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.5/community/x86_64/APKINDEX.tar.gz
ERROR: unsatisfiable constraints:
py-pip (virtual):
provided by: py2-pip
required by: world[py-pip]
Upgrade to Docker 1.12.6
&& curl -sL https://get.docker.com/builds/Linux/x86_64/docker-1.12.6 > /usr/bin/docker \
Update alpine linux to new version 3.4.
https://github.com/gliderlabs/docker-alpine/tree/master
Add synchronization functionality files between origin - destination and destination - origin.
For aws s3 use this: http://docs.aws.amazon.com/cli/latest/reference/s3/sync.html
It would be nice if the script created the AWS bucket if it doesn't exist. Currently it just says A client error (NoSuchBucket) occurred when calling the PutObject operation: The specified bucket does not exist
.
When using this is output to the console
starting Helicopterizer ...
Cloud Provider is Amazon Simple Storage Service (S3)
STORAGE_PROVIDER=AWS
BACKUP_NAME=docker-atlassian
BACKUP_VERSION=2016-06-13T02:26:51Z
DATA_PATH=/data/
CRON_SCHEDULE=
GZIP_COMPRESSION=true
AWS_ACCESS_KEY_ID=xxxxx
AWS_SECRET_ACCESS_KEY=xxxxxxx
AWS_DEFAULT_REGION=us-east-1
That exposes the key and id to the output, logs etc.
testIt () {
local backupPrefix=$1
local backupName=$2
local name=''
if [ -n "$backupName" ]; then
name="1"
else
name="2"
fi
echo "$name"
}
BACKUP_PREFIX=
BACKUP_NAME=jenkins
echo $(test $BACKUP_PREFIX $BACKUP_NAME)
# Ouput 2
BACKUP_PREFIX="beurk"
echo $(test $BACKUP_PREFIX $BACKUP_NAME)
# Output 1
Upgrade to Alpine 3.5.
FROM alpine:3.5
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.