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
- Host: GitHub
- URL: https://github.com/nxexox/pykaniko
- Owner: nxexox
- License: apache-2.0
- Created: 2019-10-06T18:29:36.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-07-19T09:14:43.000Z (almost 4 years ago)
- Last Synced: 2025-04-22T10:38:27.774Z (about 1 year ago)
- Topics: docker, google, kaniko, python
- Language: Python
- Homepage:
- Size: 14.6 KB
- Stars: 11
- Watchers: 1
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
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,
)
```