Skip to content

Commit

Permalink
Merge pull request #3 from dxw/do-all-the-things
Browse files Browse the repository at this point in the history
Make the docker image useful for both MySQL and PostgreSQL
  • Loading branch information
rjw1 authored Feb 22, 2024
2 parents 6e14374 + 8c1b632 commit 639d6be
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
README.md
renovate.json
build.sh
25 changes: 23 additions & 2 deletions Dockerfile
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

13 changes: 8 additions & 5 deletions README.md
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
5 changes: 5 additions & 0 deletions build.sh
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" .

0 comments on commit 639d6be

Please sign in to comment.