mirror of
				https://github.com/linuxkit/linuxkit.git
				synced 2025-10-31 10:19:22 +00:00 
			
		
		
		
	Replace riddler with code that constructs config.json directly
Generated largely from the specified config; small parts taken from `docker image inspect`, such as the command line. Renamed some of the yaml keys to match the OCI spec rather than Docker Compose as we decided they are more readable, no more underscores. Add some extra functionality - tmpfs specification - fully general mount specification - no new privileges can be specified now For nostalgic reasons, using engine-api to talk to the docker cli as we only need an old API version, and it is nice and easy to vendor... Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This commit is contained in:
		
							
								
								
									
										32
									
								
								vendor/github.com/docker/go-connections/sockets/unix_socket.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								vendor/github.com/docker/go-connections/sockets/unix_socket.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,32 @@ | ||||
| // +build !windows | ||||
|  | ||||
| package sockets | ||||
|  | ||||
| import ( | ||||
| 	"net" | ||||
| 	"os" | ||||
| 	"syscall" | ||||
| ) | ||||
|  | ||||
| // NewUnixSocket creates a unix socket with the specified path and group. | ||||
| func NewUnixSocket(path string, gid int) (net.Listener, error) { | ||||
| 	if err := syscall.Unlink(path); err != nil && !os.IsNotExist(err) { | ||||
| 		return nil, err | ||||
| 	} | ||||
| 	mask := syscall.Umask(0777) | ||||
| 	defer syscall.Umask(mask) | ||||
|  | ||||
| 	l, err := net.Listen("unix", path) | ||||
| 	if err != nil { | ||||
| 		return nil, err | ||||
| 	} | ||||
| 	if err := os.Chown(path, 0, gid); err != nil { | ||||
| 		l.Close() | ||||
| 		return nil, err | ||||
| 	} | ||||
| 	if err := os.Chmod(path, 0660); err != nil { | ||||
| 		l.Close() | ||||
| 		return nil, err | ||||
| 	} | ||||
| 	return l, nil | ||||
| } | ||||
		Reference in New Issue
	
	Block a user