mirror of
https://github.com/containers/podman-compose.git
synced 2025-04-22 16:39:01 +02:00
build specific service
This commit is contained in:
parent
efba3a1380
commit
4e2e960106
@ -1089,8 +1089,17 @@ def build_one(compose, args, cnt):
|
|||||||
|
|
||||||
@cmd_run(podman_compose, 'build', 'build stack images')
|
@cmd_run(podman_compose, 'build', 'build stack images')
|
||||||
def compose_build(compose, args):
|
def compose_build(compose, args):
|
||||||
for cnt in compose.containers:
|
if args.services:
|
||||||
build_one(compose, args, cnt)
|
container_names_by_service = compose.container_names_by_service
|
||||||
|
for service in args.services:
|
||||||
|
try:
|
||||||
|
cnt = compose.container_by_name[container_names_by_service[service][0]]
|
||||||
|
except:
|
||||||
|
raise ValueError("unknown service: " + service)
|
||||||
|
build_one(compose, args, cnt)
|
||||||
|
else:
|
||||||
|
for cnt in compose.containers:
|
||||||
|
build_one(compose, args, cnt)
|
||||||
|
|
||||||
def create_pods(compose, args):
|
def create_pods(compose, args):
|
||||||
for pod in compose.pods:
|
for pod in compose.pods:
|
||||||
@ -1383,7 +1392,8 @@ def compose_build_parse(parser):
|
|||||||
help="attempt to pull a newer version of the image, Raise an error even if the image is present locally.", action='store_true')
|
help="attempt to pull a newer version of the image, Raise an error even if the image is present locally.", action='store_true')
|
||||||
parser.add_argument("--build-arg", metavar="key=val", action="append", default=[],
|
parser.add_argument("--build-arg", metavar="key=val", action="append", default=[],
|
||||||
help="Set build-time variables for services.")
|
help="Set build-time variables for services.")
|
||||||
|
parser.add_argument('services', metavar='services', nargs='*',default=None,
|
||||||
|
help='affected services')
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
podman_compose.run()
|
podman_compose.run()
|
||||||
|
Loading…
Reference in New Issue
Block a user