Skip to content

Commit

Permalink
Merge pull request #4310 from afbjorklund/building
Browse files Browse the repository at this point in the history
Add some CRI-agnostic image build documentation
  • Loading branch information
tstromberg authored May 21, 2019
2 parents 5e42017 + 44b51ec commit 33c217e
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@

* **Reusing the Docker Daemon** ([reusing_the_docker_daemon.md](reusing_the_docker_daemon.md)): How to point your docker CLI to the docker daemon running inside minikube

* **Building images within the VM** ([building_images_within_the_vm.md](building_images_within_the_vm.md)): How to build a container image within the minikube VM

#### Storage

* **Persistent Volumes** ([persistent_volumes.md](persistent_volumes.md)): Persistent Volumes in Minikube and persisted locations in the VM
Expand Down
31 changes: 31 additions & 0 deletions docs/building_images_within_the_vm.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Building images within the VM

When using a single VM of Kubernetes it's really handy to build inside the VM; as this means you don't have to build on your host machine and push the image into a docker registry - you can just build inside the same machine as minikube which speeds up local experiments.

## Docker (containerd)

For Docker, you can either set up your host docker client to communicate by [reusing the docker daemon](reusing_the_docker_daemon.md).

Or you can use `minikube ssh` to connect to the virtual machine, and run the `docker build` there:

```shell
docker build
```

For more information on the `docker build` command, read the [Docker documentation](https://docs.docker.com/engine/reference/commandline/build/) (docker.com).

## Podman (cri-o)

For Podman, there is no daemon running. The processes are started by the user, monitored by `conmon`.

So you need to use `minikube ssh`, and you will also make sure to run the command as the root user:

```shell
sudo -E podman build
```

For more information on the `podman build` command, read the [Podman documentation](https://github.com/containers/libpod/blob/master/docs/podman-build.1.md) (podman.io).

## Build context

For the build context you can use any directory on the virtual machine, or any address on the network.

0 comments on commit 33c217e

Please sign in to comment.