Skip to content

Commit c179efa

Browse files
committed
docs: document MySQL 5.0 image
1 parent f35598c commit c179efa

3 files changed

Lines changed: 240 additions & 7 deletions

File tree

CLAUDE.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,25 @@ bd close <id> # Complete work
5252

5353
## Build & Test
5454

55-
_Add your build and test commands here_
56-
5755
```bash
58-
# Example:
59-
# npm install
60-
# npm test
56+
make build # Build linux/amd64 by default
57+
make structure # Verify package, config, and image cleanup
58+
make smoke # Verify initialization and persistence
59+
make smoke-all # Build and smoke all release platforms
60+
make build-all # Build all platforms into Buildx cache
6161
```
6262

6363
## Architecture Overview
6464

65-
_Add a brief overview of your project architecture_
65+
The image packages Debian Etch's pinned MySQL 5.0.32 server/client packages.
66+
`docker-entrypoint.sh` initializes empty datadirs through a socket-only temporary
67+
server and leaves existing datadirs unchanged. Releases publish one manifest
68+
for `linux/amd64`, `linux/386`, and `linux/arm/v5`.
6669

6770
## Conventions & Patterns
6871

69-
_Add your project-specific conventions here_
72+
- Keep pinned APT installation before local `COPY` instructions.
73+
- Keep shell compatible with Debian Etch's Bash 3 and validate with `bash -n`.
74+
- Preserve Docker Official Image semantics where MySQL 5.0 supports them.
75+
- Use non-interactive cleanup and never commit database dumps.
76+
- Run `make structure` and `make smoke` after runtime changes.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Oblak Studio
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 205 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
1+
# oblakstudio/mysql50
2+
3+
[![MySQL Version](https://img.shields.io/badge/MySQL-5.0.32-00758F?logo=mysql&logoColor=white)](https://hub.docker.com/r/oblakstudio/mysql50)
4+
[![Docker Image Version](https://img.shields.io/docker/v/oblakstudio/mysql50?sort=semver&logo=docker&logoColor=white&label=image&color=2496ED)](https://hub.docker.com/r/oblakstudio/mysql50/tags)
5+
[![Docker Pulls](https://img.shields.io/docker/pulls/oblakstudio/mysql50?logo=docker&logoColor=white&color=2496ED)](https://hub.docker.com/r/oblakstudio/mysql50)
6+
[![Docker Image Size](https://img.shields.io/docker/image-size/oblakstudio/mysql50/latest?logo=docker&logoColor=white&label=size&color=2496ED)](https://hub.docker.com/r/oblakstudio/mysql50/tags)
7+
[![Release](https://img.shields.io/github/actions/workflow/status/oblakstudio/mysql50-docker/release.yml?branch=master&logo=githubactions&logoColor=white&label=release)](https://github.com/oblakstudio/mysql50-docker/actions/workflows/release.yml)
8+
![Platform](https://img.shields.io/badge/platform-amd64%20%7C%20386%20%7C%20arm%2Fv5-2496ED?logo=linux&logoColor=white)
9+
![Base](https://img.shields.io/badge/base-Debian%20Etch%204.0-A81D33?logo=debian&logoColor=white)
10+
![Maintenance](https://img.shields.io/maintenance/yes/2026)
11+
12+
---
13+
14+
Legacy **MySQL 5.0** packaged for modern container workflows. The image uses
15+
Debian Etch's archived `5.0.32-7etch12` packages and follows the Docker Official
16+
Image's first-run environment contract where MySQL 5.0 supports it.
17+
18+
> [!WARNING]
19+
> MySQL 5.0 and Debian Etch are end-of-life software with known, unpatched
20+
> security issues. This image exists for trusted legacy workloads. Never expose
21+
> it directly to the public internet or another untrusted network.
22+
23+
## Tags
24+
25+
The wrapped MySQL version is fixed; image releases are versioned independently
26+
with semantic-release.
27+
28+
| Tag | Description |
29+
| --- | --- |
30+
| `latest` | Newest image release |
31+
| `5.0.32` | Fixed wrapped MySQL version |
32+
| `X.Y.Z` | Exact image release, such as `1.0.0` |
33+
| `X.Y`, `X` | Moving semantic image-release aliases |
34+
35+
All tags contain MySQL 5.0.32 on Debian Etch.
36+
37+
## Architectures
38+
39+
The image index publishes these Etch-supported platforms:
40+
41+
- `linux/amd64`
42+
- `linux/386`
43+
- `linux/arm/v5`
44+
45+
There is no native `linux/arm64` image. An ARM64 host must explicitly request
46+
and emulate the 32-bit ARM image when its Docker/QEMU setup supports it:
47+
48+
```bash
49+
docker run --rm --platform=linux/arm/v5 \
50+
-e MYSQL_ROOT_PASSWORD=secret \
51+
oblakstudio/mysql50
52+
```
53+
54+
## Quick start
55+
56+
```bash
57+
docker run --rm -d --name mysql50 \
58+
-e MYSQL_ROOT_PASSWORD=secret \
59+
-p 3306:3306 \
60+
oblakstudio/mysql50
61+
```
62+
63+
Connect from a client with MySQL's native password protocol:
64+
65+
```bash
66+
mysql -h127.0.0.1 -P3306 -uroot -psecret
67+
```
68+
69+
## Environment variables
70+
71+
First-run initialization accepts the familiar official-image variables:
72+
73+
| Variable | Description |
74+
| --- | --- |
75+
| `MYSQL_ROOT_PASSWORD` | Password for `root` |
76+
| `MYSQL_ALLOW_EMPTY_PASSWORD` | Allow an empty root password when non-empty; insecure |
77+
| `MYSQL_RANDOM_ROOT_PASSWORD` | Generate a root password and print it once |
78+
| `MYSQL_ROOT_HOST` | Additional root host; defaults to `%` |
79+
| `MYSQL_DATABASE` | Database to create |
80+
| `MYSQL_USER` / `MYSQL_PASSWORD` | Non-root user to create; both are required |
81+
| `MYSQL_INITDB_SKIP_TZINFO` | Skip loading timezone tables when non-empty |
82+
83+
One of `MYSQL_ROOT_PASSWORD`, `MYSQL_ALLOW_EMPTY_PASSWORD`, or
84+
`MYSQL_RANDOM_ROOT_PASSWORD` is required for an empty datadir.
85+
86+
`MYSQL_ROOT_PASSWORD`, `MYSQL_ROOT_HOST`, `MYSQL_DATABASE`, `MYSQL_USER`, and
87+
`MYSQL_PASSWORD` also accept mutually exclusive `*_FILE` forms for Docker
88+
secrets:
89+
90+
```bash
91+
docker run -d --name mysql50 \
92+
-e MYSQL_ROOT_PASSWORD_FILE=/run/secrets/mysql-root \
93+
-v ./mysql-root-password:/run/secrets/mysql-root:ro \
94+
oblakstudio/mysql50
95+
```
96+
97+
`MYSQL_ROOT_HOST` defaults to `%`, matching the current Docker Official Image,
98+
so root can connect across a Docker network. Protect the container at the
99+
network boundary or set `MYSQL_ROOT_HOST=localhost` when remote root access is
100+
not needed.
101+
102+
MySQL 5.0 cannot expire an account password using the newer official-image
103+
mechanism. Setting `MYSQL_ONETIME_PASSWORD` therefore produces an explicit
104+
error rather than being silently ignored.
105+
106+
## Initialization files
107+
108+
Files in `/docker-entrypoint-initdb.d/` run in glob order only when the datadir
109+
is empty:
110+
111+
- `*.sh` files are sourced.
112+
- `*.sql` files are executed by the MySQL client.
113+
- `*.sql.gz` files are decompressed and executed.
114+
115+
When `MYSQL_DATABASE` is set, SQL files run with that database selected.
116+
117+
```bash
118+
docker run -d --name mysql50 \
119+
-e MYSQL_ROOT_PASSWORD=secret \
120+
-e MYSQL_DATABASE=legacy_app \
121+
-v ./seed.sql:/docker-entrypoint-initdb.d/seed.sql:ro \
122+
oblakstudio/mysql50
123+
```
124+
125+
## Data persistence
126+
127+
The image declares `/var/lib/mysql` as a volume. Mount a named volume to retain
128+
data across containers:
129+
130+
```bash
131+
docker run -d --name mysql50 \
132+
-e MYSQL_ROOT_PASSWORD=secret \
133+
-v mysql50-data:/var/lib/mysql \
134+
oblakstudio/mysql50
135+
```
136+
137+
If `/var/lib/mysql/mysql` already exists, initialization variables and init
138+
files are ignored. Existing databases, accounts, and passwords are not changed.
139+
140+
## Password hashing
141+
142+
`my.cnf` defaults to `old_passwords = 0`, so accounts created during
143+
initialization use MySQL 5.0's native 41-byte hashes. This is more compatible
144+
with later clients than the pre-4.1 16-byte format.
145+
146+
Applications that require old hashes can mount a replacement `/etc/mysql/my.cnf`
147+
before initializing a new datadir. Changing the option does not rewrite hashes
148+
already stored in an existing datadir.
149+
150+
## Configuration and server options
151+
152+
The bundled `my.cnf` sets the socket, PID file, datadir, port, password-hash
153+
mode, and `bind-address = 0.0.0.0`. Mount a complete replacement at
154+
`/etc/mysql/my.cnf` to override it.
155+
156+
Arguments beginning with `-` are passed to `mysqld`:
157+
158+
```bash
159+
docker run -d -e MYSQL_ROOT_PASSWORD=secret \
160+
oblakstudio/mysql50 --max-connections=200
161+
```
162+
163+
## Building and testing
164+
165+
```bash
166+
make build # Build linux/amd64 by default
167+
make build-all # Build all release platforms into the Buildx cache
168+
make structure # Verify package, config, and image cleanup
169+
make smoke # Verify initialization, TCP auth, init files, and persistence
170+
make smoke-all # Build and smoke all platforms under native/QEMU execution
171+
make run # Run the selected image locally
172+
make shell # Open Bash in the selected image
173+
```
174+
175+
Override `PLATFORM`, `IMAGE`, `VERSION`, `ROOT_PASSWORD`, or `PORT` as needed.
176+
Multi-platform targets require a Buildx builder with the corresponding QEMU
177+
handlers.
178+
179+
## Releases
180+
181+
Pushes to `master` run semantic-release using Conventional Commits. A published
182+
GitHub release triggers Buildx, which publishes one manifest containing amd64,
183+
386, and arm/v5 images. Image release tags (`1.0.0`, `1.0`, `1`) evolve while
184+
the fixed upstream tag remains `5.0.32`.
185+
186+
## How it works
187+
188+
MySQL 5.0 is no longer available from current distribution repositories. The
189+
Dockerfile starts from `debian/eol:etch-slim` and installs the archived,
190+
architecture-specific `mysql-server-5.0` and `mysql-client-5.0` packages pinned
191+
to Debian revision `5.0.32-7etch12`.
192+
193+
The package-created datadir is deleted in the installation layer. On first
194+
container start, `docker-entrypoint.sh` creates system tables, configures
195+
accounts through a socket-only temporary server, processes init files, shuts
196+
the temporary server down, and finally starts the networked server as `mysql`.
197+
198+
## Credits and license
199+
200+
Built and maintained by [Oblak Studio](https://oblak.studio). MySQL is a
201+
trademark of Oracle Corporation. This repository packages already released
202+
legacy software and is not affiliated with or endorsed by Oracle.
203+
204+
The Dockerfile, entrypoint, tests, and workflow files are released under the
205+
[MIT License](LICENSE).

0 commit comments

Comments
 (0)