-
Go to your project's directory
-
Tar up the folder:
tar -C . -zcvf context.tar.gz .
- Use the newly created
context.tar
and build an image with kaniko:
docker run \
-v $(pwd):/workspace \
gcr.io/kaniko-project/executor:latest \
--dockerfile /workspace/Dockerfile \
--context dir:///workspace/ \
--destination image \
--tarPath=/workspace/image.tar \
--no-push
- Load the newly created image to your docker daemon:
docker load -i image.tar
- Tag the loaded image:
docker tag <IMAGE_ID> your-project-name
Note: Since we've used a tar file to build the image most likely your image's name will be "none".
- Run your image:
docker run your-project-name