An open API service indexing awesome lists of open source software.

https://github.com/nxexox/pykaniko

Python client for Google Kaniko
https://github.com/nxexox/pykaniko

docker google kaniko python

Last synced: about 1 year ago
JSON representation

Python client for Google Kaniko

Awesome Lists containing this project

README

          

### [Kaniko](https://github.com/GoogleContainerTools/kaniko) is a tool to build container images from a Dockerfile

---

#### How to install
For installation kaniko add in your Dockerfile the next lines
```
FROM gcr.io/kaniko-project/executor:v0.12.0 AS kaniko

FROM

ENV DOCKER_CONFIG /kaniko/.docker

COPY --from=kaniko /kaniko /kaniko
...
```

**pip**
```
pip install kaniko
```

---

#### How to use:
```python
from kaniko import Kaniko, KanikoSnapshotMode

kaniko = Kaniko()
kaniko.dockerfile = '/path/to/Dockerfile'
kaniko.no_push = True
kaniko.snapshot_mode = KanikoSnapshotMode.full

build_logs = kaniko.build() # List[str]
```

Another way:
```python
from kaniko import Kaniko, KanikoSnapshotMode

kaniko = Kaniko()
build_logs = kaniko.build(
docker_registry_uri='https://index.docker.io/v1/',
registry_username='username',
registry_password='password',
destination='path-to-repo:tag',
dockerfile='/path/to/Dockerfile',
snapshot_mode=KanikoSnapshotMode.full,
)
```