Skip to content

Commit 421e0d8

Browse files
committed
refactor: alpine 3.15
1 parent dd52f2e commit 421e0d8

File tree

8 files changed

+73
-191
lines changed

8 files changed

+73
-191
lines changed

.drone.yml

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

Dockerfile

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
FROM alpine:3.15
2+
3+
ARG VERSION=0.0.0
4+
ENV VERSION=${VERSION}
5+
6+
LABEL version="${VERSION}" \
7+
description="MySQL client for easy export and import databases using Docker." \
8+
maintainer="Jose Quintana <joseluisq.net>"
9+
10+
# Dependencies
11+
ENV BUILD_DEPS="gettext"
12+
ENV RUNTIME_DEPS="libintl"
13+
ARG ENVE_VERSION=1.4.0
14+
15+
# Custom user
16+
ARG USER_NAME
17+
ARG USER_HOME_DIR
18+
19+
ENV USER_NAME=${USER_NAME:-mysql}
20+
ENV USER_HOME_DIR=${USER_HOME_DIR:-/home/${USER_NAME}}
21+
22+
RUN set -eux \
23+
&& adduser -h ${USER_HOME_DIR} -s /sbin/nologin -u 1000 -D ${USER_NAME} \
24+
&& apk --no-cache add ca-certificates tzdata mysql-client nano dumb-init \
25+
&& apk add --update $RUNTIME_DEPS \
26+
&& apk add --virtual build_deps $BUILD_DEPS \
27+
&& cp /usr/bin/envsubst /usr/local/bin/envsubst \
28+
&& apk del build_deps \
29+
&& wget --quiet -O /tmp/enve.tar.gz \
30+
"https://github.com/joseluisq/enve/releases/download/v${ENVE_VERSION}/enve_v${ENVE_VERSION}_linux_amd64.tar.gz" \
31+
&& tar xzvf /tmp/enve.tar.gz -C /usr/local/bin enve \
32+
&& enve -v \
33+
&& rm -rf /tmp/enve.tar.gz \
34+
&& chmod +x /usr/local/bin/enve \
35+
&& true
36+
37+
COPY ./__mysqldump.sh /usr/local/bin/__mysqldump.sh
38+
COPY ./mysql_exporter /usr/local/bin/mysql_exporter
39+
COPY ./__mysqlimport.sh /usr/local/bin/__mysqlimport.sh
40+
COPY ./mysql_importer /usr/local/bin/mysql_importer
41+
42+
RUN set -eux \
43+
&& chmod +x /usr/local/bin/__mysqldump.sh \
44+
&& chmod +x /usr/local/bin/__mysqlimport.sh \
45+
&& chmod +x /usr/local/bin/mysql_exporter \
46+
&& chmod +x /usr/local/bin/mysql_importer \
47+
&& true
48+
49+
USER ${USER_NAME}
50+
51+
WORKDIR ${USER_HOME_DIR}
52+
53+
VOLUME ${USER_HOME_DIR}
54+
55+
ENTRYPOINT [ "/usr/bin/dumb-init" ]
56+
57+
CMD [ "mysql" ]
58+
59+
# Metadata
60+
LABEL org.opencontainers.image.vendor="Jose Quintana" \
61+
org.opencontainers.image.url="https://github.com/joseluisq/alpine-mysql-client" \
62+
org.opencontainers.image.title="Alpine / MySQL Client" \
63+
org.opencontainers.image.description="MySQL client for easy export and import databases using Docker." \
64+
org.opencontainers.image.version="v${VERSION}" \
65+
org.opencontainers.image.documentation="https://github.com/joseluisq/alpine-mysql-client/blob/master/README.md"

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2020 Jose Quintana <https://git.io/joseluisq>
3+
Copyright (c) 2020-present Jose Quintana <https://git.io/joseluisq>
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy of
66
this software and associated documentation files (the "Software"), to deal in

Makefile

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
build:
2-
@docker build -t alpine-mysql-client:latest -f docker/Dockerfile .
2+
@docker build -t alpine-mysql-client:latest -f Dockerfile .
33
.PHONY: build
44

55
export:
@@ -23,15 +23,3 @@ import:
2323
alpine-mysql-client:latest \
2424
mysql_importer import.env
2525
.PHONY: import
26-
27-
release:
28-
# 2. Update docker files to latest tag
29-
./docker/version.sh $(ARGS)
30-
31-
# 3. Commit and push to latest tag
32-
git add docker/Dockerfile
33-
git commit docker/Dockerfile -m "$(ARGS)"
34-
git tag $(ARGS)
35-
git push origin master
36-
git push origin $(ARGS)
37-
.ONESHELL: release

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# Alpine / MySQL Client ![Docker Pulls](https://img.shields.io/docker/pulls/joseluisq/alpine-mysql-client)
1+
# Docker MySQL Client ![Docker Image Size](https://img.shields.io/docker/image-size/joseluisq/static-web-server/2) ![Docker Image Version](https://img.shields.io/docker/v/joseluisq/static-web-server/2) ![Docker Pulls](https://img.shields.io/docker/pulls/joseluisq/alpine-mysql-client.svg)
22

3-
> [MySQL client](https://dev.mysql.com/doc/refman/8.0/en/programs-client.html) for easy export and import databases using Docker.
3+
> [MySQL client](https://dev.mysql.com/doc/refman/8.0/en/programs-client.html) for easy **export** and **import** databases using Docker.
44
5-
🐳 View on [Docker Hub](https://hub.docker.com/r/joseluisq/alpine-mysql-client/)
5+
🐳 View on [Docker Hub](https://hub.docker.com/r/joseluisq/alpine-mysql-client/)
66

77
## MySQL Client programs
88

9-
**Note:** [MySQL client (mariadb-client)](https://pkgs.alpinelinux.org/package/v3.11/main/x86_64/mysql-client) is an alias package for [mysql-client](https://dev.mysql.com/doc/refman/8.0/en/programs-client.html) migration tools.
9+
**NOTE:** [MySQL client (mariadb-client)](https://pkgs.alpinelinux.org/package/v3.11/main/x86_64/mysql-client) is an alias package for [mysql-client](https://dev.mysql.com/doc/refman/8.0/en/programs-client.html) migration tools.
1010

1111
```sh
1212
mysql
@@ -25,7 +25,7 @@ mysqlshow
2525

2626
For more details check it out:
2727

28-
- [MariaDB 10 - Clients & Utilities](https://mariadb.com/kb/en/clients-utilities/)
28+
- [MariaDB 10 - Clients and Utilities](https://mariadb.com/kb/en/clients-utilities/)
2929
- [MySQL 8 - Client Programs](https://dev.mysql.com/doc/refman/8.0/en/programs-client.html)
3030

3131
## User privileges
@@ -181,4 +181,4 @@ Feel free to send a [pull request](https://github.com/joseluisq/alpine-mysql-cli
181181

182182
MIT license
183183

184-
© 2020 [Jose Quintana](https://git.io/joseluisq)
184+
© 2020-present [Jose Quintana](https://git.io/joseluisq)

docker/Dockerfile

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

docker/tmpl.Dockerfile

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

docker/version.sh

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

0 commit comments

Comments
 (0)