From 22c29027cc96765bda854bc4bc98f4ff5844bd20 Mon Sep 17 00:00:00 2001 From: stilobique Date: Fri, 24 Feb 2023 02:22:59 +0100 Subject: [PATCH] WIP to start the container with a script --- generate-image-repo.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/generate-image-repo.py b/generate-image-repo.py index b08b53f..4185109 100644 --- a/generate-image-repo.py +++ b/generate-image-repo.py @@ -17,6 +17,8 @@ def get_repo_container(): dk_container_name = 'blender-cache-repo' dk_images_local = client.images.list(name=dk_tags) dk_containers_local = client.containers.list(filters={'label': dk_container_name}) + volumes = ["/scripts/:/scripts"] + commandes = ['bash', '/scripts/set_all_repository.sh'] if dk_containers_local: # The container cache exist, used-it @@ -30,7 +32,7 @@ def get_repo_container(): else: # No container, no image ; build a new image and start this cache client.images.build(path="image", dockerfile="Dockerfile-csv", tag=f'{dk_tags}:latest', rm=True) - client.containers.run(image=dk_tags, name=dk_container_name) + client.containers.run(image=dk_tags, name=dk_container_name, volumes=volumes, command=commandes) if __name__ == "__main__":