Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions .github/workflows/build_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,22 @@ jobs:
- uses: actions/checkout@v3
with:
ref: refs/heads/main
- name: Free Disk Space
#- name: Free Disk Space
# run: |
# ./free_disk_space.sh
- name: Store Docker Images on /mnt/docker
run: |
./free_disk_space.sh
./docker.py
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build Docker Images
run: |
df -lh
docker ps
#df -lh
#docker ps
./build_images.py --branch '${{ github.event.inputs.branch }}' --repo '${{ github.event.inputs.repo }}' --root-image-name '${{ github.event.inputs.root_image_name }}'
cat graph.yaml
docker ps
df -lh
#docker ps
#df -lh
30 changes: 30 additions & 0 deletions docker.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env python3
import json
from pathlib import Path
import subprocess as sp


def config_data_root(data_root: str) -> dict[str, str]:
Path(data_root).mkdir(parents=True, exists_ok=True)
settings = {}
path = Path("/etc/docker/daemon.json")
if path.is_file():
with path.open("r", encoding="utf-8") as fin:
settings = json.load(fin)
settings["data-root"] = data_root
with path.open("w", encoding="utf-8") as fout:
json.dump(settings, fout, indent=4)
return settings


def store_docker_on_mnt():
sp.run(cmd="systemctl stop docker", shell=True, check=True)
settings = config_data_root("/mnt/docker")
print(settings)
sp.run(cmd="systemctl start docker", shell=True, check=True)
sp.run(cmd="docker info", shell=True, check=True)


if __name__ == "__main__":
store_docker_on_mnt()

Loading