-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker.py
More file actions
42 lines (35 loc) · 832 Bytes
/
docker.py
File metadata and controls
42 lines (35 loc) · 832 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
from faasmtools.docker import (
CR_NAME,
build_container,
push_container,
)
from invoke import task
from os.path import join
from tasks.env import (
PROJ_ROOT,
get_version,
)
CONTAINER_IMAGE = "{}/cpython".format(CR_NAME)
DOCKERFILE = join(PROJ_ROOT, "Dockerfile")
def _get_tag():
tag_name = "{}:{}".format(CONTAINER_IMAGE, get_version())
return tag_name
@task(default=True)
def build(ctx, nocache=False, push=False):
"""
Build current version of the cpython container
"""
build_container(
_get_tag(),
DOCKERFILE,
PROJ_ROOT,
nocache=nocache,
push=push,
build_args={"FAASM_PYTHON_VERSION": get_version()},
)
@task
def push(ctx):
"""
Push the current version of the cpython container
"""
push_container(_get_tag())