def call(Map args) {
def defaults = [
cache: true,
- cachettl: "100000h",
+ cachettl: "14d",
dockerfile: 'Dockerfile',
repo: env.CONTAINER_REGISTRY,
- version: env.BRANCH_NAME
+ version: env.BRANCH_NAME + "-latest"
]
args = defaults << args
container('kaniko') {
sh """
echo "Building container with settings: ${args}"
/kaniko/executor --dockerfile ${args.dockerfile} --cache=${args.cache} --cache-ttl=${args.cachettl} --context \$( pwd )/${args.context} --destination ${args.repo}/${args.container}:${args.version}
+ rm -rf /kaniko/*[0-9]* && rm -rf /kaniko/Dockerfile && mkdir -p /workspace
"""
}
}