diff --git a/misc/docker/dock.go b/misc/docker/dock.go new file mode 100644 index 000000000..6a201e205 --- /dev/null +++ b/misc/docker/dock.go @@ -0,0 +1,43 @@ +/* +Copyright 2015 The Camlistore Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Command dock builds Camlistore's various Docker images. +package main + +import ( + "log" + "os" + "os/exec" + "path/filepath" + + "camlistore.org/pkg/osutil" +) + +func main() { + camDir, err := osutil.GoPackagePath("camlistore.org") + if err != nil { + log.Fatalf("Error looking up camlistore.org dir: %v", err) + } + dockDir := filepath.Join(camDir, "misc", "docker") + + cmd := exec.Command("docker", "build", "-t", "camlistore/go", ".") + cmd.Dir = filepath.Join(dockDir, "go") + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + if err := cmd.Run(); err != nil { + log.Fatalf("Error building camlistore/go: %v", err) + } +} diff --git a/misc/docker/go/Dockerfile b/misc/docker/go/Dockerfile index 14e85e290..70e6d506a 100644 --- a/misc/docker/go/Dockerfile +++ b/misc/docker/go/Dockerfile @@ -2,7 +2,8 @@ FROM debian:stable ENV DEBIAN_FRONTEND noninteractive RUN apt-get update && apt-get -y upgrade -RUN apt-get -y install curl gcc +RUN apt-get -y --no-install-recommends install curl gcc +RUN apt-get -y --no-install-recommends install ca-certificates libc6-dev # Get Go stable release WORKDIR /tmp