Skip to content

Commit b893bec

Browse files
d-bytebaseclaude
andauthored
docs: simplify Docker image pinning documentation (#797)
* docs: simplify Docker image pinning documentation - Move Docker image pinning section from upgrade.mdx to production-setup.mdx - Simplify explanation to focus on using SHA256 digest for version pinning - Remove outdated version management and downgrade sections - Remove unnecessary migration history modification steps - Delete unused change-migration-history.webp image 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * chore: update --------- Co-authored-by: Claude <[email protected]>
1 parent 0682f7c commit b893bec

File tree

3 files changed

+10
-101
lines changed

3 files changed

+10
-101
lines changed
Binary file not shown.

mintlify/get-started/self-host/production-setup.mdx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,20 @@ Teams that frequently work with large SQL files may need more.
2626

2727
## Production Setup Checklist
2828

29-
### Prerequisites
29+
### Essential Configuration
3030

3131
- Review system requirements (see above)
3232
- [Configure External PostgreSQL](/get-started/self-host/external-postgres/)
3333
- [Configure External Access](/get-started/self-host/external-access)
3434
- [Configure External URL](/get-started/self-host/external-url)
3535
- Pin Docker image to specific version instead of `latest` ([changelog](https://docs.bytebase.com/changelog))
36+
37+
While version tags like `3.7.0` are better than `latest`, Bytebase may still add patches to existing versions. For a truly fixed version, use the SHA256 digest from [Docker Hub](https://hub.docker.com/r/bytebase/bytebase/tags).
38+
39+
```bash
40+
# Pin to exact image using digest (prevents any updates)
41+
docker pull bytebase/bytebase:3.7.0@sha256:00b436855b08739aad02fd52e41b5d74c03db9c70c49ce5de42376347cd1403c
42+
```
3643

3744
### Monitoring
3845

mintlify/get-started/self-host/upgrade.mdx

Lines changed: 2 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,8 @@ psql -h <<host>> -p <<port>> -U <<user>> postgres -c "DROP DATABASE metadb_old"
7373

7474
#### Restore Option 2 - Restore to a different database `metadb2`
7575

76-
##### Step 1 - Modify the dump file
7776

78-
The dump file records the Bytebase metadata schema change history, and it's database specific. So we
79-
need to change the existing record value from `metadb` to `metadb2` first, which means to transfer
80-
the change history to `metadb2`.
81-
82-
Locate the `migration_history` table in the dump file, and for each record, find the value `metadb`
83-
which corresponds to the `namespace` column, change each occurrence from `metadb` to `metadb2`.
84-
85-
![change-migration-history](/content/docs/administration/back-up-data/change-migration-history.webp)
86-
87-
##### Step 2 - Restore metadata to `metadb2`
77+
##### Step 1 - Restore metadata to `metadb2`
8878

8979
Create a new db `metadb2`:
9080

@@ -98,7 +88,7 @@ Restore metadata to the new db:
9888
psql -h <<host>> -p <<port>> -U <<user>> metadb2 < metadb.sql
9989
```
10090

101-
##### Step 3 - Drop the old metadata db
91+
##### Step 2 - Drop the old metadata db
10292

10393
Restart Bytebase and verify the metadata is restored properly. Afterwards, you can drop the old database:
10494

@@ -147,91 +137,3 @@ Take Docker as an example (**follow the below steps exactly**):
147137

148138
<TerminalDockerRunVolume />
149139

150-
## Version Management
151-
152-
Bytebase adopts [Semantic Versioning](https://semver.org/) using the MAJOR.MINOR.PATCH format.
153-
154-
Bytebase ties the version number with the underlying database schema progression, because:
155-
156-
1. Schema change is a good approximate to the functional change. Large schema changes often indicate large functional changes.
157-
1. Schema change determines the customer involvement when upgrading to the new version.
158-
159-
- `MAJOR` version change usually happens once a year. It _might_ require manual effort from the customer. Bytebase will
160-
try to avoid that if possible.
161-
- `MINOR` version is changed when the underlying database schema changes. While the upgrade does not require customer involvement. `MINOR` version change usually happens about once every month.
162-
- `PATCH` version is changed when the new version does not include underlying database schema changes. `PATCH` version change usually happens bi-weekly following our release schedule.
163-
164-
## Docker Image Version
165-
166-
Certain changes maybe cherry-picked into the existing version. So when Bytebase starts next time, it will self-upgrade.
167-
If you don't want this behavior, you could use the image digest to pin the exact commit. For example,
168-
169-
```bash
170-
# https://hub.docker.com/repository/docker/bytebase/bytebase/tags/3.7.0/sha256-29be3c651d4fc93c6aab37046b41128015a9be5d6f02b2490353962c469c5110
171-
docker pull bytebase/bytebase:3.7.0@sha256:00b436855b08739aad02fd52e41b5d74c03db9c70c49ce5de42376347cd1403c
172-
```
173-
174-
The docker image is built with [OpenContainers Annotations](https://specs.opencontainers.org/image-spec/annotations/):
175-
176-
```bash
177-
docker inspect bytebase/bytebase:3.7.0 | jq -r '.[0].Config.Labels'
178-
{
179-
"org.opencontainers.image.revision": "fb430b0626c33d3431e750dc0cc446f3c8a434a8",
180-
"org.opencontainers.image.version": "3.7.0"
181-
}
182-
183-
# Digest also works
184-
docker inspect bytebase/bytebase:3.7.0@sha256:00b436855b08739aad02fd52e41b5d74c03db9c70c49ce5de42376347cd1403c | jq -r '.[0].Config.Labels'
185-
{
186-
"org.opencontainers.image.revision": "ec5d81d554287258095377c076528d8ab6664fa0",
187-
"org.opencontainers.image.version": "3.7.0"
188-
}
189-
```
190-
191-
- `org.opencontainers.image.revision` is the git commit hash, in the example, it corresponds to the [particular git commit](https://github.com/bytebase/bytebase/commit/fb430b0626c33d3431e750dc0cc446f3c8a434a8)
192-
- `org.opencontainers.image.version` is the release version, in the example, it corresponds to the [3.7.0 release branch](https://github.com/bytebase/bytebase/commits/release/3.7.0).
193-
194-
If you want to check the commit history for the image, the best way is to visit the release branch page and locate the commit:
195-
196-
![release-commit](/content/docs/get-started/upgrade/release-commit.webp)
197-
198-
## Upgrade from Old Version
199-
200-
To upgrade, replace the version string with the target version and restart. Bytebase will self-upgrade automatically.
201-
202-
### Upgrade from 1.x or 2.x
203-
204-
First upgrade to 2.1.0 and then follow the next section.
205-
206-
### Upgrade from 3.0.0 ~ 3.3.0
207-
208-
First upgrade to 3.3.1 and then follow the next section.
209-
210-
### Upgrade from 3.3.1
211-
212-
Replace the version string with the latest version and restart.
213-
214-
## Downgrade
215-
216-
<Warning>
217-
Downgrade is as dangerous as upgrade, we highly recommend you verify the downgrade in a test
218-
environment first.
219-
</Warning>
220-
221-
### Downgrade PATCH Version
222-
223-
Downgrades carry the same risks as upgrades, so validate any downgrade in a test environment before proceeding.
224-
225-
### Downgrade MINOR Version
226-
227-
Minor version upgrade/downgrade involves metadata schema change, so we must restore the metadata database to the old version first.
228-
Thus the metadata backup for the old version must be available.
229-
230-
1. Stop Bytebase
231-
1. Restore the metadata database with the metadata backup
232-
1. Replace the version with the old version.
233-
1. Start Bytebase
234-
235-
### Downgrade MAJOR Version
236-
237-
Not supported

0 commit comments

Comments
 (0)