mirror of https://github.com/perkeep/perkeep.git
misc/docker: add zoneinfo to GCE docker image
Fixes #736 Change-Id: Ie58719716e1b4759ccec99a46ecc104eb86449ce
This commit is contained in:
parent
c3d438abc3
commit
dec44e57fe
|
@ -78,10 +78,11 @@ var (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
goDockerImage = "camlistore/go"
|
goDockerImage = "camlistore/go"
|
||||||
djpegDockerImage = "camlistore/djpeg"
|
djpegDockerImage = "camlistore/djpeg"
|
||||||
serverImage = "camlistore/server"
|
zoneinfoDockerImage = "camlistore/zoneinfo"
|
||||||
goCmd = "/usr/local/go/bin/go"
|
serverImage = "camlistore/server"
|
||||||
|
goCmd = "/usr/local/go/bin/go"
|
||||||
// Path to where the Camlistore builder is mounted on the camlistore/go image.
|
// Path to where the Camlistore builder is mounted on the camlistore/go image.
|
||||||
genCamliProgram = "/usr/local/bin/build-camlistore-server.go"
|
genCamliProgram = "/usr/local/bin/build-camlistore-server.go"
|
||||||
genBinariesProgram = "/usr/local/bin/build-binaries.go"
|
genBinariesProgram = "/usr/local/bin/build-binaries.go"
|
||||||
|
@ -215,6 +216,18 @@ func genDjpeg(ctxDir string) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func genZoneinfo(ctxDir string) {
|
||||||
|
cmd := exec.Command("docker", "run",
|
||||||
|
"--rm",
|
||||||
|
"--volume="+ctxDir+":/OUT",
|
||||||
|
zoneinfoDockerImage, "/bin/bash", "-c", "mkdir -p /OUT && cp -a /usr/share/zoneinfo /OUT/zoneinfo")
|
||||||
|
cmd.Stdout = os.Stdout
|
||||||
|
cmd.Stderr = os.Stderr
|
||||||
|
if err := cmd.Run(); err != nil {
|
||||||
|
log.Fatalf("Error generating zoneinfo in go container: %v", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func buildServer(ctxDir string) {
|
func buildServer(ctxDir string) {
|
||||||
copyFinalDockerfile(ctxDir)
|
copyFinalDockerfile(ctxDir)
|
||||||
cmd := exec.Command("docker", "build", "-t", serverImage, ".")
|
cmd := exec.Command("docker", "build", "-t", serverImage, ".")
|
||||||
|
@ -576,8 +589,10 @@ func main() {
|
||||||
switch {
|
switch {
|
||||||
case *doImage:
|
case *doImage:
|
||||||
buildDockerImage("djpeg-static", djpegDockerImage)
|
buildDockerImage("djpeg-static", djpegDockerImage)
|
||||||
|
buildDockerImage("zoneinfo", zoneinfoDockerImage)
|
||||||
genCamlistore(ctxDir)
|
genCamlistore(ctxDir)
|
||||||
genDjpeg(ctxDir)
|
genDjpeg(ctxDir)
|
||||||
|
genZoneinfo(ctxDir)
|
||||||
buildServer(ctxDir)
|
buildServer(ctxDir)
|
||||||
case *doBinaries:
|
case *doBinaries:
|
||||||
genBinaries(ctxDir)
|
genBinaries(ctxDir)
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
FROM scratch
|
FROM scratch
|
||||||
MAINTAINER Camlistore Contributors <camlistore@googlegroups.com>
|
MAINTAINER Camlistore Contributors <camlistore@googlegroups.com>
|
||||||
ADD djpeg /usr/bin/djpeg
|
ADD djpeg /usr/bin/djpeg
|
||||||
|
# Because one of the default zoneinfo dirs on linux. See zoneDirs in time/zoneinfo_unix.go
|
||||||
|
ADD zoneinfo /usr/share/zoneinfo
|
||||||
ADD camlistore.org /camlistore
|
ADD camlistore.org /camlistore
|
||||||
|
|
||||||
EXPOSE 80 443
|
EXPOSE 80 443
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
# Copyright 2016 The Camlistore Authors.
|
||||||
|
|
||||||
|
FROM debian:stable
|
||||||
|
ENV DEBIAN_FRONTEND noninteractive
|
||||||
|
RUN apt-get update && apt-get -y upgrade
|
||||||
|
RUN apt-get -y install tzdata
|
Loading…
Reference in New Issue