Back to listGo
Docker-style Container Config
Lv.5643@mukitaro10 playsDec 28, 2025
Container configuration structures inspired by Docker. Go's flagship project.
preview.go
1package container2 3import (4 "context"5 "io"6)7 8type Config struct {9 Hostname string10 Domainname string11 User string12 Env []string13 Cmd []string14 Image string15 WorkingDir string16 Labels map[string]string17}18 19type Container struct {20 ID string21 Config *Config22 State *State23 Created int6424}25 26type State struct {27 Running bool28 Paused bool29 Pid int30 ExitCode int31 StartedAt string32 FinishedAt string33}34 35func (c *Container) Start(ctx context.Context) error {36 c.State.Running = true37 return nil38}39 40func (c *Container) Stop(ctx context.Context) error {41 c.State.Running = false42 return nil43}Custom problems are not included in rankings