add support for shm_size - #567
Open
madejackson wants to merge 3 commits into
Open
Conversation
shm_size was an integer byte count (int64), but docker-compose specifies
it as a {amount}{unit} byte-size string (e.g. "64mb", "1gb"). Align
Cosmos with the upstream docker behavior:
- src/docker/api_blueprint.go: ContainerCreateRequestContainer.ShmSize is now
a string; parse to raw bytes via units.RAMInBytes at create time (mirroring
mem_limit/mem_reservation).
- src/docker/export.go: format the daemon's raw byte count back to a compact
byte-size string on export so round-trips behave the same.
- client docker-compose.jsx: stop coercing shm_size to a number; keep the
byte-size string (bare numbers normalized to raw-byte string for compat).
- go-sdk: DockerContainerCreateRequestContainer.ShmSize is now *string.
Co-authored-by: Plurality by Beyond Cloud
Contributor
Author
|
What commit 17e69eb does Aligns Cosmos's The problem: Docker Compose specifies The fix:
Result: |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR enables support for shm_size in servapps.
I tested it on my system and also tested if it works for imports and backups, and it does.