Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport packaging fixes #6525

Merged
merged 5 commits into from
Mar 12, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update build image from debian 6 to 7 (#6508)
debian 6 has reached EOL and no longer has a valid package signing key,
making apt-get installs unsafe.
  • Loading branch information
graphaelli authored and andrewkroh committed Mar 11, 2018
commit 7d5d7916fb7101380d1dc33626ca7b350c232bf3
2 changes: 1 addition & 1 deletion dev-tools/packer/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
/env/

# copied over from xgo-image/
docker/xgo-image-deb6/base/build.sh
docker/xgo-image-deb7/base/build.sh
20 changes: 10 additions & 10 deletions dev-tools/packer/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ BUILDID?=$(shell git rev-parse HEAD)
SNAPSHOT?=yes

BEATS_BUILDER_IMAGE?=tudorg/beats-builder
BEATS_BUILDER_DEB6_IMAGE?=tudorg/beats-builder-deb6
BEATS_BUILDER_DEB_IMAGE?=tudorg/beats-builder-deb7
BEATS_GOPATH=$(firstword $(subst :, ,${GOPATH}))

makefile_abspath:=$(abspath $(lastword $(MAKEFILE_LIST)))
Expand Down Expand Up @@ -46,9 +46,9 @@ deps:
.PHONY: xgo-image
xgo-image:
cd $(packer_absdir)/docker/xgo-image/; ./build.sh
# copy build.sh script in the xgo-image-deb6 to avoid code duplication
cp $(packer_absdir)/docker/xgo-image/base/build.sh $(packer_absdir)/docker/xgo-image-deb6/base/build.sh
cd $(packer_absdir)/docker/xgo-image-deb6/; ./build.sh
# copy build.sh script in the xgo-image-deb7 to avoid code duplication
cp $(packer_absdir)/docker/xgo-image/base/build.sh $(packer_absdir)/docker/xgo-image-deb7/base/build.sh
cd $(packer_absdir)/docker/xgo-image-deb7/; ./build.sh

.PHONY: fpm-image
fpm-image:
Expand All @@ -72,12 +72,12 @@ ${BUILD_DIR}/upload/build_id.txt:
deb-rpm-s3:
$(packer_absdir)/docker/deb-rpm-s3/build.sh

.PHONY: run-interactive-builder-deb6
run-interactive-builder-deb6:
.PHONY: run-interactive-builder-deb
run-interactive-builder-deb:
docker run -t -i -v $(shell pwd)/build:/build \
-v $(shell pwd)/xgo-scripts/:/scripts \
-v $(shell pwd)/../..:/source \
--entrypoint=bash ${BEATS_BUILDER_DEB6_IMAGE}
--entrypoint=bash ${BEATS_BUILDER_DEB_IMAGE}

.PHONY: run-interactive-builder
run-interactive-builder:
Expand All @@ -92,14 +92,14 @@ images: xgo-image fpm-image go-daemon-image
.PHONY: push-images
push-images:
docker push ${BEATS_BUILDER_IMAGE}
docker push ${BEATS_BUILDER_DEB6_IMAGE}
docker push ${BEATS_BUILDER_DEB_IMAGE}
docker push tudorg/fpm
docker push tudorg/go-daemon

.PHONY: pull-images
pull-images:
docker pull ${BEATS_BUILDER_IMAGE}
docker pull ${BEATS_BUILDER_DEB6_IMAGE}
docker pull ${BEATS_BUILDER_DEB_IMAGE}
docker pull tudorg/fpm
docker pull tudorg/go-daemon

Expand All @@ -119,7 +119,7 @@ endef

.PHONY: clean-images
clean-images:
@$(call rm-image, ${BEATS_BUILDER_DEB6_IMAGE})
@$(call rm-image, ${BEATS_BUILDER_DEB_IMAGE})
@$(call rm-image, ${BEATS_BUILDER_IMAGE})

.PHONY: clean
Expand Down
2 changes: 0 additions & 2 deletions dev-tools/packer/docker/xgo-image-deb6/base/sources.list

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@
#
# Released under the MIT license.

FROM debian:6
FROM debian:7

MAINTAINER Tudor Golubenco <tudor@elastic.co>

# Use sources list from the archive
ADD sources.list /etc/apt/sources.list

# Configure the Go environment, since it's not going to change
ENV PATH /usr/local/go/bin:$PATH
ENV GOPATH /go
Expand All @@ -23,7 +20,7 @@ RUN chmod +x $FETCH

# Make sure apt-get is up to date and dependent packages are installed
RUN \
apt-get -o Acquire::Check-Valid-Until=false update && \
apt-get update && \
apt-get install -y automake autogen build-essential ca-certificates \
gcc-multilib \
clang llvm-dev libtool libxml2-dev uuid-dev libssl-dev pkg-config \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<<<<<<< HEAD:dev-tools/packer/docker/xgo-image-deb6/beats-builder/Dockerfile
FROM tudorg/xgo-deb6-1.9.2
=======
FROM tudorg/xgo-deb7-1.9.4
>>>>>>> cefe024e4... update build image from debian 6 to 7 (#6508):dev-tools/packer/docker/xgo-image-deb7/beats-builder/Dockerfile

MAINTAINER Tudor Golubenco <tudor@elastic.co>

Expand All @@ -11,7 +15,7 @@ RUN \

# Get libpcap-64 binaries by compiling from source
RUN \
apt-get -o Acquire::Check-Valid-Until=false update && \
apt-get update && \
apt-get install -y flex bison
RUN ./fetch.sh http://www.tcpdump.org/release/libpcap-1.8.1.tar.gz 32d7526dde8f8a2f75baf40c01670602aeef7e39 && \
mkdir -p /libpcap/amd64 && \
Expand Down
6 changes: 6 additions & 0 deletions dev-tools/packer/docker/xgo-image-deb7/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh
cp -r ../../../vendor/gopkg.in/yaml.v2 beats-builder/yaml.v2
cp -r ../../../vendor/github.com/tsg/gotpl beats-builder/gotpl
docker build --rm=true -t tudorg/xgo-deb7-base base/ && \
docker build --rm=true -t tudorg/xgo-deb7-1.9.4 go-1.9.4/ &&
docker build --rm=true -t tudorg/beats-builder-deb7 beats-builder
15 changes: 15 additions & 0 deletions dev-tools/packer/docker/xgo-image-deb7/go-1.9.4/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Go cross compiler (xgo): Go 1.9.4 layer
# Copyright (c) 2014 Péter Szilágyi. All rights reserved.
#
# Released under the MIT license.

FROM tudorg/xgo-deb7-base

MAINTAINER Tudor Golubenco <tudor@elastic.co>

# Configure the root Go distribution and bootstrap based on it
RUN \
export ROOT_DIST="https://storage.googleapis.com/golang/go1.9.4.linux-amd64.tar.gz" && \
export ROOT_DIST_SHA1="ed1bd37c356338a5a04923c183931a96687f202e" && \
\
$BOOTSTRAP_PURE
6 changes: 3 additions & 3 deletions libbeat/scripts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ TARGETS_OLD?="linux/amd64 linux/386" ## @building list of Debian6 architecture t
PACKAGES?=${BEAT_NAME}/deb ${BEAT_NAME}/rpm ${BEAT_NAME}/darwin ${BEAT_NAME}/win ${BEAT_NAME}/bin ## @Building List of OS to be supported by "make package"
SNAPSHOT?=yes ## @Building If yes, builds a snapshot version
BEATS_BUILDER_IMAGE?=tudorg/beats-builder ## @Building Name of the docker image to use when packaging the application
BEATS_BUILDER_DEB6_IMAGE?=tudorg/beats-builder-deb6 ## @Building Name of the docker image to use when packaging the application for Debian 6
BEATS_BUILDER_DEB_IMAGE?=tudorg/beats-builder-deb7 ## @Building Name of the docker image to use when packaging the application for Debian 7

ifeq ($(DOCKER_CACHE),0)
DOCKER_NOCACHE=--no-cache
Expand Down Expand Up @@ -415,7 +415,7 @@ prepare-package-cgo:
-e BEAT_NAME=${BEAT_NAME} \
${BEATS_BUILDER_IMAGE}

# linux builds on debian 6 for compatibility
# linux builds on older debian for compatibility
docker run --rm \
-v ${BUILD_DIR}:/build \
-v $(abspath ${ES_BEATS}/dev-tools/packer/xgo-scripts):/scripts \
Expand All @@ -429,7 +429,7 @@ prepare-package-cgo:
-e ES_BEATS=${ES_BEATS} \
-e BEAT_PATH=${BEAT_PATH} \
-e BEAT_NAME=${BEAT_NAME} \
${BEATS_BUILDER_DEB6_IMAGE}
${BEATS_BUILDER_DEB_IMAGE}

# Prepares images for packaging
.PHONY: package-setup
Expand Down