WIP to start the container with a script

This commit is contained in:
2023-02-24 02:22:59 +01:00
parent 6cb46c4b46
commit 22c29027cc
+3 -1
View File
@@ -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__":