-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from dxw/do-all-the-things
Make the docker image useful for both MySQL and PostgreSQL
- Loading branch information
Showing
4 changed files
with
39 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
README.md | ||
renovate.json | ||
build.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,25 @@ | ||
FROM postgres:latest | ||
RUN apt-get update && apt-get install -y awscli && apt-get clean | ||
FROM debian:bookworm-slim | ||
RUN apt-get update && \ | ||
apt-get install -y \ | ||
awscli \ | ||
postgresql-client \ | ||
wget \ | ||
curl \ | ||
gnupg \ | ||
# default-mysql-client \ | ||
&& apt-get clean | ||
|
||
RUN key='BCA4 3417 C3B4 85DD 128E C6D4 B7B3 B788 A8D3 785C'; \ | ||
export GNUPGHOME="$(mktemp -d)"; \ | ||
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key"; \ | ||
mkdir -p /etc/apt/keyrings; \ | ||
gpg --batch --export "$key" > /etc/apt/keyrings/mysql.gpg; \ | ||
gpgconf --kill all; \ | ||
rm -rf "$GNUPGHOME" | ||
RUN echo 'deb [ signed-by=/etc/apt/keyrings/mysql.gpg ] http://repo.mysql.com/apt/debian/ bookworm mysql-8.0' > /etc/apt/sources.list.d/mysql.list \ | ||
&& apt-get update \ | ||
&& apt-get install -y mysql-community-client \ | ||
&& rm -f /etc/apt/keyrings/mysql.gpg /etc/apt/sources.list.d/mysql.list \ | ||
&& apt-get update \ | ||
&& apt-get clean | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
# Docker image for PostgresSQL backups on Dalmatian to S3 | ||
# Docker image for sql backups on Dalmatian to S3 | ||
|
||
We use this image to backup our PostgresSQL databases to S3. It is based on the | ||
[official PostgresSQL image](https://hub.docker.com/_/postgres/) but adds the | ||
[AWS CLI](https://aws.amazon.com/cli/) so that we can push to S3. It also adds | ||
AWS certs. | ||
We use this image to backup our MySQL and PostgresSQL databases to S3. | ||
|
||
This image contains the following tools: | ||
|
||
- PostgreSQL client tools | ||
- MySQL client tools | ||
- aws cli |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#/bin/bash | ||
# | ||
|
||
# set the platform to linux/amd64 so that mysql can be installed if running the build on a mac. | ||
docker build --platform linux/amd64 -t "dalmatian-sql-backup:latest" . |