Layerstash
Layerstash is a tool designed to store large files as image layers in container registries such as GHCR or Docker Hub. Files exceeding 5GB will be uploaded and downloaded as separate ~5GB image layers.
Tag schema: <BASE_TAG>-<CHUNK_NUMBER>
Why does this exist?
While most storage providers (Google Drive, OneDrive, Dropbox, AWS, etc) charge for storage above a certain low minimum, Docker Hub (disclaimer) and GHCR (disclaimer) provide unlimited storage for free accounts.
In my personal testing, I have stored a total of 1.8TB in a public repository on Docker Hub androsh7/archive.
Legal Disclaimer
Layerstash is not affiliated with or endorsed by Docker, GitHub, or any container registry provider. Users are responsible for complying with the Terms of Service and acceptable use policies of any registry they interact with. Registry providers may impose rate limits, storage limits, or account restrictions at their discretion.
Security Disclaimer
Data is stored as-is inside container image layers. Do not upload secrets or sensitive data unless it is encrypted beforehand.
Download
usage: layerstash download [-h] [--version] [--log-level {trace,debug,info,warning,critical}] -r REPOSITORY -t BASE_TAG --registry {docker,ghcr} -o OUTFILE [-u USERNAME] [-p TOKEN]
options:
-h, --help show this help message and exit
--log-level {trace,debug,info,warning,critical}
Set the application log level
-r, --repository REPOSITORY
Name of the remote repository, i.e., androsh7/archive
-t, --base-tag BASE_TAG
The base tag, i.e., "python-ftp" , each chunk will have "-<INDEX>" appended to the end
--registry {docker,ghcr}
The registry to use ('docker', 'ghcr'), default: "docker"
-o, --outfile OUTFILE
The file to write the downloaded chunks to
-u, --username USERNAME
Docker username
-p, --token TOKEN Docker PAT token
Examples:
# Download without authentication (only possible for public repositories)
layerstash download -r androsh7/archive -t python-ftp -o python-ftp.tar
# Download with authentication
layerstash download -r androsh7/archive -t python-ftp -o python-ftp.tar -u androsh7 -p docker_pat_23492dx1c75812375dx82375
Note: Downloads can be resumed by rerunning the same command
Upload
usage: layerstash upload [-h] [--version] [--log-level {trace,debug,info,warning,critical}] -r REPOSITORY -t BASE_TAG --registry {docker,ghcr} -i INFILE [--overwrite] -u USERNAME
-p TOKEN
options:
-h, --help show this help message and exit
--log-level {trace,debug,info,warning,critical}
Set the application log level
-r, --repository REPOSITORY
Name of the remote repository, i.e., androsh7/archive
-t, --base-tag BASE_TAG
The base tag, i.e., "python-ftp" , each chunk will have "-<INDEX>" appended to the end
--registry {docker,ghcr}
The registry to use ('docker', 'ghcr'), default: "docker"
-i, --infile INFILE The file to upload
--overwrite Overwrite existing images if they have a different hash
-u, --username USERNAME
Docker username
-p, --token TOKEN Docker PAT token
Examples:
# Docker upload
layerstash upload -r androsh7/archive -t python-ftp -i python-ftp.tar -u androsh7 -p docker_pat_23492dx1c75812375dx82375
# GHCR upload
layerstash upload --registry ghcr -r androsh7/archive -t python-ftp -i python-ftp.tar -u androsh7 -p docker_pat_23492dx1c75812375dx82375
Development
To run the repository locally:
git clone https://github.com/androsh7/layerstash
cd layerstash
python3 -m venv .venv # Recommended to use python3.13
pip install -e .[dev]
python3 layerstash/main.py
To build the executables, use the build.py script:
usage: build.py [-h] [--windows] [--linux] [--build-all]
options:
-h, --help show this help message and exit
--windows Build the Windows executable
--linux Build the Linux executable
--build-all Build the Windows and Linux executable
Metadata
Release files for layerstash 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| layerstash-1.0.0.tar.gz | 13.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| layerstash-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 27.5 kB
Release files / layerstash-1.0.0.tar.gz
| Download URL | layerstash-1.0.0.tar.gz |
|---|---|
| Size | 13.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
598764a71592d4b4f232411473df7f887fa746661a32f5844260b0c789f0fb91
|
|
BLAKE2b-256 checksum How to use checksums |
355bcdf351632ac793f720a453b57cfa9fb27358d4b03562ab706493f1fd0516
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 25, 2026.
Transparency logRelease files / layerstash-1.0.0-py3-none-any.whl
| Download URL | layerstash-1.0.0-py3-none-any.whl |
|---|---|
| Size | 14.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cba0e5280de05309b03dfcd8e16bea421ae746bd9fe456a830480763917768d7
|
|
BLAKE2b-256 checksum How to use checksums |
60fac9af4108f87351b19a2f36e2e6cdd86f3e6baf0af623fd118f5792781326
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 25, 2026.
Transparency log