mirror of
				https://github.com/linuxkit/linuxkit.git
				synced 2025-10-31 08:41:13 +00:00 
			
		
		
		
	vsudd: add /pkg/vsudd with README and example yml
Signed-off-by: Magnus Skjegstad <magnus@skjegstad.com>
This commit is contained in:
		
							
								
								
									
										14
									
								
								pkg/vsudd/Dockerfile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								pkg/vsudd/Dockerfile
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,14 @@ | ||||
| FROM linuxkit/alpine:630ee558e4869672fae230c78364e367b8ea67a9 AS mirror | ||||
|  | ||||
| RUN apk add --no-cache go musl-dev git build-base | ||||
| ENV GOPATH=/go PATH=$PATH:/go/bin  | ||||
| ENV VIRTSOCK_COMMIT=a381dcc5bcddf1d7f449495c373dbf70f8e501c0 | ||||
|  | ||||
| RUN git clone https://github.com/linuxkit/virtsock.git /go/src/github.com/linuxkit/virtsock && \ | ||||
|     cd /go/src/github.com/linuxkit/virtsock && \ | ||||
|     git checkout $VIRTSOCK_COMMIT && \ | ||||
|     make vsudd | ||||
|  | ||||
| FROM scratch | ||||
| COPY --from=mirror /go/src/github.com/linuxkit/virtsock/build/vsudd.linux /vsudd | ||||
| ENTRYPOINT ["/vsudd"] | ||||
							
								
								
									
										15
									
								
								pkg/vsudd/Makefile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								pkg/vsudd/Makefile
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,15 @@ | ||||
| default: push | ||||
|  | ||||
| ORG?=linuxkit | ||||
| IMAGE=vsudd | ||||
| DEPS=$(wildcard *.go) Makefile Dockerfile | ||||
|  | ||||
| HASH?=$(shell git ls-tree HEAD -- ../$(notdir $(CURDIR)) | awk '{print $$3}') | ||||
|  | ||||
| tag: $(DEPS) | ||||
| 	docker build --squash --no-cache -t $(ORG)/$(IMAGE):$(HASH) . | ||||
|  | ||||
| push: tag | ||||
| 	DOCKER_CONTENT_TRUST=1 docker pull $(ORG)/$(IMAGE):$(HASH) || \ | ||||
| 	DOCKER_CONTENT_TRUST=1 docker push $(ORG)/$(IMAGE):$(HASH) | ||||
|  | ||||
							
								
								
									
										23
									
								
								pkg/vsudd/README.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								pkg/vsudd/README.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,23 @@ | ||||
| #### Vsudd | ||||
|  | ||||
| Vsudd is a daemon that forwards unix domain socket traffic from the host to the | ||||
| guest VM via VSOCK. It can be used to control other daemons, like `containerd` | ||||
| and `dockerd`, from the host.  An example configuration file is available in | ||||
| [examples/vsudd.yml](/examples/vsudd.yml). | ||||
|  | ||||
| After building the example, run the example with `linuxkit run hyperkit | ||||
| -vsock-ports 2374 vsudd`. This will create a unix domain socket in the state | ||||
| directory that map to the `containerd` control socket. The socket is called | ||||
| `guest.00000946`. | ||||
|  | ||||
| If you install the `ctr` tool on the host you should be able to access the | ||||
| `containerd` running in the VM: | ||||
|  | ||||
| ``` | ||||
| $ go get -u -ldflags -s github.com/containerd/containerd/cmd/ctr | ||||
| ... | ||||
| $ ctr -a vsudd-state/guest.00000946 list | ||||
| ID        IMAGE     PID       STATUS | ||||
| vsudd               466       RUNNING | ||||
| ``` | ||||
|  | ||||
		Reference in New Issue
	
	Block a user