Permalink
Browse files

Fix rpm and dpkg builders. Add Debian buster support.

  • Loading branch information...
Aaron Hopkins
Aaron Hopkins committed Jun 7, 2018
1 parent 2bbe3fb commit 270714eb2fa726ea5180b8ebf94041a4598d4f07
Showing with 99 additions and 56 deletions.
  1. +31 −0 Dockerfile.dpkg-buster
  2. +16 −14 Dockerfile.dpkg-jessie
  3. +16 −14 Dockerfile.dpkg-stretch
  4. +18 −14 Dockerfile.rpm-centos6
  5. +18 −14 Dockerfile.rpm-centos7
View
@@ -0,0 +1,31 @@
# Build Fotomat RPM for Debian buster using Docker.
#
# Run: dist/build dpkg-buster
#
# And you'll end up with a fotomat*.dpkg in the current directory.
FROM debian:buster
# Apt-get our dependencies, download, build, and install VIPS, and download and install Go.
ADD preinstall.sh /app/src/github.com/die-net/fotomat/
RUN DEBIAN_FRONTEND=noninteractive CFLAGS="-O2 -ftree-vectorize -msse2 -ffast-math -fPIC" \
VIPS_OPTIONS="--disable-shared --enable-static" \
/app/src/github.com/die-net/fotomat/preinstall.sh
# Add dpkg build tool.
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y -q --no-install-recommends fakeroot
# Create a few directories
# mkdir -p /app/pkg /app/bin
# Add the rest of our code.
ADD . /app/src/github.com/die-net/fotomat/
# Build and install Fotomat
RUN GOPATH=/app CGO_LDFLAGS_ALLOW="-Wl,--export-dynamic" /usr/local/go/bin/go get -tags vips_static -t github.com/die-net/fotomat/...
# Test fotomat
RUN GOPATH=/app CGO_LDFLAGS_ALLOW="-Wl,--export-dynamic" /usr/local/go/bin/go test -tags vips_static -v github.com/die-net/fotomat/...
# Build the dpkg.
RUN /app/src/github.com/die-net/fotomat/dist/build-dpkg /app/bin/fotomat
View
@@ -6,24 +6,26 @@
FROM debian:jessie
# Apt-get our dependencies, download, build, and install VIPS, and download and install Go.
ADD preinstall.sh /app/src/github.com/die-net/fotomat/
RUN DEBIAN_FRONTEND=noninteractive CFLAGS="-O2 -ftree-vectorize -msse2 -ffast-math -fPIC" \
VIPS_OPTIONS="--disable-shared --enable-static" \
/app/src/github.com/die-net/fotomat/preinstall.sh
RUN \
# Apt-get our dependencies, download, build, and install VIPS, and download and install Go.
DEBIAN_FRONTEND=noninteractive CFLAGS="-O2 -ftree-vectorize -msse2 -ffast-math -fPIC" VIPS_OPTIONS="--disable-shared --enable-static" \
/app/src/github.com/die-net/fotomat/preinstall.sh && \
# Add dpkg build tool.
DEBIAN_FRONTEND=noninteractive apt-get install -y -q --no-install-recommends fakeroot && \
# Add dpkg build tool.
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y -q --no-install-recommends fakeroot
# Create a few directories
mkdir -p /app/pkg /app/bin
# Create a few directories
# mkdir -p /app/pkg /app/bin
# Add the rest of our code.
ADD . /app/src/github.com/die-net/fotomat/
RUN \
# Build, install, and test fotomat
GOPATH=/app /usr/local/go/bin/go get -tags vips_static -t github.com/die-net/fotomat/... && \
GOPATH=/app /usr/local/go/bin/go test -tags vips_static -v github.com/die-net/fotomat/... && \
# Build and install Fotomat
RUN GOPATH=/app CGO_LDFLAGS_ALLOW="-Wl,--export-dynamic" /usr/local/go/bin/go get -tags vips_static -t github.com/die-net/fotomat/...
# Build the dpkg.
/app/src/github.com/die-net/fotomat/dist/build-dpkg /app/bin/fotomat
# Test fotomat
RUN GOPATH=/app CGO_LDFLAGS_ALLOW="-Wl,--export-dynamic" /usr/local/go/bin/go test -tags vips_static -v github.com/die-net/fotomat/...
# Build the dpkg.
RUN /app/src/github.com/die-net/fotomat/dist/build-dpkg /app/bin/fotomat
View
@@ -6,24 +6,26 @@
FROM debian:stretch
# Apt-get our dependencies, download, build, and install VIPS, and download and install Go.
ADD preinstall.sh /app/src/github.com/die-net/fotomat/
RUN DEBIAN_FRONTEND=noninteractive CFLAGS="-O2 -ftree-vectorize -msse2 -ffast-math -fPIC" \
VIPS_OPTIONS="--disable-shared --enable-static" \
/app/src/github.com/die-net/fotomat/preinstall.sh
RUN \
# Apt-get our dependencies, download, build, and install VIPS, and download and install Go.
DEBIAN_FRONTEND=noninteractive CFLAGS="-O2 -ftree-vectorize -msse2 -ffast-math -fPIC" VIPS_OPTIONS="--disable-shared --enable-static" \
/app/src/github.com/die-net/fotomat/preinstall.sh && \
# Add dpkg build tool.
DEBIAN_FRONTEND=noninteractive apt-get install -y -q --no-install-recommends fakeroot && \
# Add dpkg build tool.
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y -q --no-install-recommends fakeroot
# Create a few directories
mkdir -p /app/pkg /app/bin
# Create a few directories
# mkdir -p /app/pkg /app/bin
# Add the rest of our code.
ADD . /app/src/github.com/die-net/fotomat/
RUN \
# Build, install, and test fotomat
GOPATH=/app /usr/local/go/bin/go get -tags vips_static -t github.com/die-net/fotomat/... && \
GOPATH=/app /usr/local/go/bin/go test -tags vips_static -v github.com/die-net/fotomat/... && \
# Build and install Fotomat
RUN GOPATH=/app CGO_LDFLAGS_ALLOW="-Wl,--export-dynamic" /usr/local/go/bin/go get -tags vips_static -t github.com/die-net/fotomat/...
# Build the dpkg.
/app/src/github.com/die-net/fotomat/dist/build-dpkg /app/bin/fotomat
# Test fotomat
RUN GOPATH=/app CGO_LDFLAGS_ALLOW="-Wl,--export-dynamic" /usr/local/go/bin/go test -tags vips_static -v github.com/die-net/fotomat/...
# Build the dpkg.
RUN /app/src/github.com/die-net/fotomat/dist/build-dpkg /app/bin/fotomat
View
@@ -6,23 +6,27 @@
FROM centos:6
# Apt-get our dependencies, download, build, and install VIPS, and download and install Go.
ADD preinstall.sh /app/src/github.com/die-net/fotomat/
RUN \
# Install our dependencies. Download, build, and install VIPS. Download and install Go.
CFLAGS="-O2 -ftree-vectorize -msse2 -ffast-math -fPIC" LDFLAGS="-lstdc++" VIPS_OPTIONS="--disable-shared --enable-static" \
/app/src/github.com/die-net/fotomat/preinstall.sh && \
# Add a tool for building RPMs.
yum -y install rpm-build
RUN CFLAGS="-O2 -ftree-vectorize -msse2 -ffast-math -fPIC" LDFLAGS="-lstdc++" VIPS_OPTIONS="--disable-shared --enable-static" \
/app/src/github.com/die-net/fotomat/preinstall.sh
# Add a tool for building RPMs.
RUN yum -y install rpm-build
# Add the rest of our code.
ADD . /app/src/github.com/die-net/fotomat/
RUN \
# Build, install, and test fotomat
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig GOPATH=/app /usr/local/go/bin/go get -tags vips_static -t github.com/die-net/fotomat/... && \
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig GOPATH=/app /usr/local/go/bin/go test -tags vips_static -v github.com/die-net/fotomat/... && \
# Build and install Fotomat
RUN PKG_CONFIG_PATH=/usr/local/lib/pkgconfig GOPATH=/app CGO_LDFLAGS_ALLOW="-Wl,--export-dynamic" \
/usr/local/go/bin/go get -tags vips_static -t github.com/die-net/fotomat/...
# Test fotomat
RUN PKG_CONFIG_PATH=/usr/local/lib/pkgconfig GOPATH=/app CGO_LDFLAGS_ALLOW="-Wl,--export-dynamic" \
/usr/local/go/bin/go test -tags vips_static -v github.com/die-net/fotomat/...
# Update specfile version and use it to build binary RPM.
perl -ne '/FotomatVersion.*\b(\d+\.\d+\.\d+)/ and print "$1\n"' /app/src/github.com/die-net/fotomat/cmd/fotomat/version.go | \
xargs -i{} perl -p -i~ -e 's/(^Version:\s+)\d+\.\d+\.\d+/${1}{}/' /app/src/github.com/die-net/fotomat/dist/rpm/fotomat.spec && \
rpmbuild -bb /app/src/github.com/die-net/fotomat/dist/rpm/fotomat.spec
# Update specfile version and use it to build binary RPM.
RUN perl -ne '/FotomatVersion.*\b(\d+\.\d+\.\d+)/ and print "$1\n"' /app/src/github.com/die-net/fotomat/cmd/fotomat/version.go | \
xargs -i{} perl -p -i~ -e 's/(^Version:\s+)\d+\.\d+\.\d+/${1}{}/' /app/src/github.com/die-net/fotomat/dist/rpm/fotomat.spec
RUN rpmbuild -bb /app/src/github.com/die-net/fotomat/dist/rpm/fotomat.spec
View
@@ -6,23 +6,27 @@
FROM centos:7
# Apt-get our dependencies, download, build, and install VIPS, and download and install Go.
ADD preinstall.sh /app/src/github.com/die-net/fotomat/
RUN \
# Install our dependencies. Download, build, and install VIPS. Download and install Go.
CFLAGS="-O2 -ftree-vectorize -msse2 -ffast-math -fPIC" LDFLAGS="-lstdc++" VIPS_OPTIONS="--disable-shared --enable-static" \
/app/src/github.com/die-net/fotomat/preinstall.sh && \
# Add a tool for building RPMs.
yum -y install rpm-build
RUN CFLAGS="-O2 -ftree-vectorize -msse2 -ffast-math -fPIC" LDFLAGS="-lstdc++" VIPS_OPTIONS="--disable-shared --enable-static" \
/app/src/github.com/die-net/fotomat/preinstall.sh
# Add a tool for building RPMs.
RUN yum -y install rpm-build
# Add the rest of our code.
ADD . /app/src/github.com/die-net/fotomat/
RUN \
# Build, install, and test fotomat
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig GOPATH=/app /usr/local/go/bin/go get -tags vips_static -t github.com/die-net/fotomat/... && \
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig GOPATH=/app /usr/local/go/bin/go test -tags vips_static -v github.com/die-net/fotomat/... && \
# Build and install Fotomat
RUN PKG_CONFIG_PATH=/usr/local/lib/pkgconfig GOPATH=/app CGO_LDFLAGS_ALLOW="-Wl,--export-dynamic" \
/usr/local/go/bin/go get -tags vips_static -t github.com/die-net/fotomat/...
# Test fotomat
RUN PKG_CONFIG_PATH=/usr/local/lib/pkgconfig GOPATH=/app CGO_LDFLAGS_ALLOW="-Wl,--export-dynamic" \
/usr/local/go/bin/go test -tags vips_static -v github.com/die-net/fotomat/...
# Update specfile version and use it to build binary RPM.
perl -ne '/FotomatVersion.*\b(\d+\.\d+\.\d+)/ and print "$1\n"' /app/src/github.com/die-net/fotomat/cmd/fotomat/version.go | \
xargs -i{} perl -p -i~ -e 's/(^Version:\s+)\d+\.\d+\.\d+/${1}{}/' /app/src/github.com/die-net/fotomat/dist/rpm/fotomat.spec && \
rpmbuild -bb /app/src/github.com/die-net/fotomat/dist/rpm/fotomat.spec
# Update specfile version and use it to build binary RPM.
RUN perl -ne '/FotomatVersion.*\b(\d+\.\d+\.\d+)/ and print "$1\n"' /app/src/github.com/die-net/fotomat/cmd/fotomat/version.go | \
xargs -i{} perl -p -i~ -e 's/(^Version:\s+)\d+\.\d+\.\d+/${1}{}/' /app/src/github.com/die-net/fotomat/dist/rpm/fotomat.spec
RUN rpmbuild -bb /app/src/github.com/die-net/fotomat/dist/rpm/fotomat.spec

0 comments on commit 270714e

Please sign in to comment.