Skip to content

Commit

Permalink
validate memory limits & error out if less than 512 KB
Browse files Browse the repository at this point in the history
  • Loading branch information
unclejack committed Jun 14, 2013
1 parent 452128f commit 9ee1116
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server.go
Expand Up @@ -652,6 +652,10 @@ func (srv *Server) ImageImport(src, repo, tag string, in io.Reader, out io.Write

func (srv *Server) ContainerCreate(config *Config) (string, error) {

if config.Memory != 0 && config.Memory < 524288 {
return "", fmt.Errorf("Memory limit must be given in bytes (minimum 524288 bytes)")
}

if config.Memory > 0 && !srv.runtime.capabilities.MemoryLimit {
config.Memory = 0
}
Expand Down

0 comments on commit 9ee1116

Please sign in to comment.