1
0
mirror of https://github.com/1C-Company/docker_fresh.git synced 2025-01-10 00:28:38 +02:00
docker_fresh/install.py
2020-04-05 16:06:36 +03:00

28 lines
657 B
Python

import subprocess
import pathlib
import os
import modules.site as site
import modules.centos as centos
import modules.db as db
sep = str(os.path.sep)
this_path = str(pathlib.Path().absolute()) + sep
distr_path = this_path + 'distr' + sep
images = []
images.append(centos.New())
images.append(db.New())
images.append(site.New())
print('Building start')
for image in images:
for command in image.commands:
print(command)
subprocess.call(' '.join(command), shell=True)
subprocess.run(['docker', 'build', '-t', 'fresh/' + image.name, 'images/' + image.name])
print('Building', image.name, 'is fihish')
print('Building finish')