Skip to content

Commit 26bad93

Browse files
committed
add gcs config
1 parent 6405503 commit 26bad93

File tree

3 files changed

+39
-31
lines changed

3 files changed

+39
-31
lines changed

Dockerfile

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,31 @@
11
FROM alpine:3.9
22

3+
4+
ARG CLOUD_SDK_VERSION=269.0.0
5+
ENV CLOUD_SDK_VERSION=$CLOUD_SDK_VERSION
6+
7+
ENV PATH /google-cloud-sdk/bin:$PATH
8+
9+
RUN apk --no-cache add \
10+
curl \
11+
python \
12+
py-crcmod \
13+
bash \
14+
libc6-compat \
15+
openssh-client \
16+
git \
17+
gnupg \
18+
&& curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-${CLOUD_SDK_VERSION}-linux-x86_64.tar.gz && \
19+
tar xzf google-cloud-sdk-${CLOUD_SDK_VERSION}-linux-x86_64.tar.gz && \
20+
rm google-cloud-sdk-${CLOUD_SDK_VERSION}-linux-x86_64.tar.gz && \
21+
gcloud config set core/disable_usage_reporting true && \
22+
gcloud config set component_manager/disable_update_check true && \
23+
gcloud config set metrics/environment github_docker_image && \
24+
gcloud --version
25+
326
RUN apk --update add mysql-client bash python3 curl &&\
427
pip3 install awscli
528

629
ADD ./rootfs/ /
730

8-
ENTRYPOINT ["/mysql2s3"]
31+
ENTRYPOINT ["/mysql2storage"]

README.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,21 @@
33
## Description
44
Easily back up from cloudSQL or any mysql instance to AWS S3.
55

6-
| Variable | Description |
7-
|-------------------------|-------------------------------------|
8-
| `MYSQL_HOST` | Mysql host |
9-
| `MYSQL_PORT` | Mysql port |
10-
| `MYSQL_DATABASE` | Mysql target database |
11-
| `MYSQL_USER` | Mysql user |
12-
| `MYSQL_PASSWORD` | Mysql password |
13-
| `AWS_ACCESS_KEY_ID` | AWS S3 accessKeyId |
14-
| `AWS_SECRET_ACCESS_KEY` | AWS S3 secretAccessKey |
15-
| `AWS_S3_FILE_PREFIX` | Prefix to generate AWS s3 file name |
16-
| `AWS_S3_BUCKET` | Target S3 bucket |
6+
| Variable | Description |
7+
|-----------------------------------|--------------------------------------|
8+
| `MYSQL_HOST` | Mysql host |
9+
| `MYSQL_PORT` | Mysql port |
10+
| `MYSQL_DATABASE` | Mysql target database |
11+
| `MYSQL_USER` | Mysql user |
12+
| `MYSQL_PASSWORD` | Mysql password |
13+
| `AWS_ACCESS_KEY_ID` | AWS S3 accessKeyId |
14+
| `AWS_SECRET_ACCESS_KEY` | AWS S3 secretAccessKey |
15+
| `AWS_S3_FILE_PREFIX` | Prefix to generate AWS s3 file name |
16+
| `AWS_S3_BUCKET` | Target S3 bucket |
17+
| `GOOGLE_APPLICATION_CREDENTIALS` | GCP json credentials |
18+
| `GCP_GCS_FILE_PREFIX` | Prefix to generate GCP gcs file name |
19+
| `GCP_GCS_BUCKET` | Target GCS bucket |
20+
1721

1822
```bash
1923
docker run -e MYSQL_HOST=mysql -e MYSQL_PORT=3306 -e MYSQL_USER=user -e MYSQL_PASSWORD=pwd -e MYSQL_DATABASE=mydb -e AWS_S3_FILE_PREFIX=s3prefix -e AWS_S3_BUCKET=mybucket --rm softonic./mysql-backup-s3

rootfs/mysql2s3

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)