Install redis-server>=3.2.4 in docker-database image (#46)
* Install redis-server>=3.2.4 * Reformat * Build redis from source code * Add Makefile var: REDIS_VERSION
This commit is contained in:
parent
ac64c1c29b
commit
e89c7be76d
33
Makefile
33
Makefile
@ -4,6 +4,9 @@
|
||||
USERNAME=
|
||||
PASSWORD_ENCRYPTED=
|
||||
|
||||
## Redis server/tools version
|
||||
REDIS_VERSION=3.2.4-1~bpo8+1_amd64
|
||||
|
||||
## Select bash for commands
|
||||
SHELL := /bin/bash
|
||||
|
||||
@ -22,14 +25,14 @@ define build_docker
|
||||
mkdir -p `dirname $(2)`
|
||||
docker save $(1) | gzip -c > $(2)
|
||||
endef
|
||||
|
||||
|
||||
## Rules: phony targets
|
||||
.phony : brcm-all mlnx-all cavm-all p4-all
|
||||
|
||||
## Rules: redirect to sub directory
|
||||
src/%:
|
||||
$(MAKE) -C src $(subst src/,,$@)
|
||||
|
||||
$(MAKE) REDIS_VERSION=$(REDIS_VERSION) -C src $(subst src/,,$@)
|
||||
|
||||
## Rules: docker-fpm
|
||||
dockers/docker-fpm/deps/fpmsyncd: src/fpmsyncd
|
||||
mkdir -p `dirname $@` && cp $< $(dir $@)
|
||||
@ -41,13 +44,13 @@ dockers/docker-team/deps/teamsyncd: src/teamsyncd
|
||||
mkdir -p `dirname $@` && cp $< $(dir $@)
|
||||
dockers/docker-team/deps/%.deb: src/%.deb
|
||||
mkdir -p `dirname $@` && cp $< $(dir $@)
|
||||
|
||||
|
||||
## Rules: docker-orchagent-mlnx
|
||||
$(addprefix dockers/docker-orchagent-mlnx/deps/,libsairedis_1.0.0_amd64.deb libsaimetadata_1.0.0_amd64.deb swss_1.0.0_amd64.deb) : dockers/docker-orchagent-mlnx/deps/%.deb : src/mlnx/%.deb
|
||||
mkdir -p `dirname $@` && cp $< $(dir $@)
|
||||
dockers/docker-orchagent-mlnx/deps/%.deb: src/%.deb
|
||||
mkdir -p `dirname $@` && cp $< $(dir $@)
|
||||
|
||||
|
||||
## Rules: docker-orchagent-cavm
|
||||
$(addprefix dockers/docker-orchagent-cavm/deps/,libsairedis_1.0.0_amd64.deb libsaimetadata_1.0.0_amd64.deb swss_1.0.0_amd64.deb) : dockers/docker-orchagent-cavm/deps/%.deb : src/cavm/%.deb
|
||||
mkdir -p `dirname $@` && cp $< $(dir $@)
|
||||
@ -59,7 +62,7 @@ $(addprefix dockers/docker-orchagent/deps/,libsairedis_1.0.0_amd64.deb libsaimet
|
||||
mkdir -p `dirname $@` && cp $< $(dir $@)
|
||||
dockers/docker-orchagent/deps/%.deb: src/%.deb
|
||||
mkdir -p `dirname $@` && cp $< $(dir $@)
|
||||
|
||||
|
||||
## Rules: docker-syncd-mlnx
|
||||
$(addprefix dockers/docker-syncd-mlnx/deps/,$(MLNX-SDK-DEBS)) : dockers/docker-syncd-mlnx/deps/%.deb : src/mlnx-sdk/%.deb
|
||||
mkdir -p `dirname $@` && cp $< $(dir $@)
|
||||
@ -86,6 +89,10 @@ $(addprefix dockers/docker-syncd/deps/,syncd_1.0.0_amd64.deb libsairedis_1.0.0_a
|
||||
dockers/docker-syncd/deps/%.deb: src/%.deb
|
||||
mkdir -p `dirname $@` && cp $< $(dir $@)
|
||||
|
||||
## Rules: docker-database
|
||||
dockers/docker-database/deps/%.deb: src/%.deb
|
||||
mkdir -p `dirname $@` && cp $< $(dir $@)
|
||||
|
||||
## Rules: docker-sonic (p4)
|
||||
$(addprefix dockers/docker-sonic-p4/deps/,swss_1.0.0_amd64.deb syncd_1.0.0_amd64.deb libsairedis_1.0.0_amd64.deb libsaimetadata_1.0.0_amd64.deb) : dockers/docker-sonic-p4/deps/%.deb : src/p4/%.deb
|
||||
mkdir -p `dirname $@` && cp $< $(dir $@)
|
||||
@ -101,7 +108,7 @@ target/docker-syncd.gz: target/docker-base.gz $(addprefix dockers/docker-syncd/d
|
||||
touch dockers/docker-syncd/deps/{dsserve,bcmcmd}
|
||||
docker load < $<
|
||||
$(call build_docker,$(patsubst target/%.gz,%,$@),$@)
|
||||
|
||||
|
||||
target/docker-syncd-mlnx.gz: target/docker-base.gz $(addprefix dockers/docker-syncd-mlnx/deps/,$(MLNX-SDK-DEBS) applibs_1.mlnx.4.2.2100_amd64.deb libhiredis0.13_0.13.3-2_amd64.deb libswsscommon_1.0.0_amd64.deb syncd_1.0.0_amd64.deb libsairedis_1.0.0_amd64.deb libsaimetadata_1.0.0_amd64.deb $(LIBNL-DEBS)) dockers/docker-syncd-mlnx/deps/fw-SPC.mfa
|
||||
docker load < $<
|
||||
$(call build_docker,$(patsubst target/%.gz,%,$@),$@)
|
||||
@ -109,11 +116,11 @@ target/docker-syncd-mlnx.gz: target/docker-base.gz $(addprefix dockers/docker-sy
|
||||
target/docker-syncd-cavm.gz: target/docker-base.gz $(addprefix dockers/docker-syncd-cavm/deps/,$(CAVM-SDK-DEBS) libhiredis0.13_0.13.3-2_amd64.deb libswsscommon_1.0.0_amd64.deb syncd_1.0.0_amd64.deb libsairedis_1.0.0_amd64.deb libsaimetadata_1.0.0_amd64.deb $(LIBNL-DEBS))
|
||||
docker load < $<
|
||||
$(call build_docker,$(patsubst target/%.gz,%,$@),$@)
|
||||
|
||||
|
||||
target/docker-orchagent.gz: target/docker-base.gz $(addprefix dockers/docker-orchagent/deps/,libhiredis0.13_0.13.3-2_amd64.deb libswsscommon_1.0.0_amd64.deb libsairedis_1.0.0_amd64.deb libsaimetadata_1.0.0_amd64.deb swss_1.0.0_amd64.deb $(LIBNL-DEBS) $(LIBTEAM-DEBS))
|
||||
docker load < $<
|
||||
$(call build_docker,$(patsubst target/%.gz,%,$@),$@)
|
||||
|
||||
|
||||
target/docker-orchagent-mlnx.gz: target/docker-base.gz $(addprefix dockers/docker-orchagent-mlnx/deps/,libhiredis0.13_0.13.3-2_amd64.deb libswsscommon_1.0.0_amd64.deb libsairedis_1.0.0_amd64.deb libsaimetadata_1.0.0_amd64.deb swss_1.0.0_amd64.deb $(LIBNL-DEBS) $(LIBTEAM-DEBS))
|
||||
docker load < $<
|
||||
$(call build_docker,$(patsubst target/%.gz,%,$@),$@)
|
||||
@ -121,7 +128,7 @@ target/docker-orchagent-mlnx.gz: target/docker-base.gz $(addprefix dockers/docke
|
||||
target/docker-orchagent-cavm.gz: target/docker-base.gz $(addprefix dockers/docker-orchagent-cavm/deps/,libhiredis0.13_0.13.3-2_amd64.deb libswsscommon_1.0.0_amd64.deb libsairedis_1.0.0_amd64.deb libsaimetadata_1.0.0_amd64.deb swss_1.0.0_amd64.deb $(LIBNL-DEBS) $(LIBTEAM-DEBS))
|
||||
docker load < $<
|
||||
$(call build_docker,$(patsubst target/%.gz,%,$@),$@)
|
||||
|
||||
|
||||
target/docker-fpm.gz: target/docker-base.gz $(addprefix dockers/docker-fpm/deps/,libswsscommon_1.0.0_amd64.deb libhiredis0.13_0.13.3-2_amd64.deb quagga_0.99.24.1-2_amd64.deb fpmsyncd)
|
||||
docker load < $<
|
||||
$(call build_docker,$(patsubst target/%.gz,%,$@),$@)
|
||||
@ -129,12 +136,12 @@ target/docker-fpm.gz: target/docker-base.gz $(addprefix dockers/docker-fpm/deps/
|
||||
target/docker-team.gz: target/docker-base.gz $(addprefix dockers/docker-team/deps/,libswsscommon_1.0.0_amd64.deb libhiredis0.13_0.13.3-2_amd64.deb $(LIBTEAM-DEBS))
|
||||
docker load < $<
|
||||
$(call build_docker,$(patsubst target/%.gz,%,$@),$@)
|
||||
|
||||
target/docker-database.gz: target/docker-base.gz
|
||||
|
||||
target/docker-database.gz: target/docker-base.gz $(addprefix dockers/docker-database/deps/,redis-server_$(REDIS_VERSION).deb redis-tools_$(REDIS_VERSION).deb)
|
||||
docker load < $<
|
||||
$(call build_docker,$(patsubst target/%.gz,%,$@),$@)
|
||||
|
||||
target/docker-sonic-p4.gz: target/docker-base.gz $(addprefix dockers/docker-sonic-p4/deps/,libswsscommon_1.0.0_amd64.deb libhiredis0.13_0.13.3-2_amd64.deb quagga_0.99.24.1-2_amd64.deb syncd_1.0.0_amd64.deb swss_1.0.0_amd64.deb libsairedis_1.0.0_amd64.deb libsaimetadata_1.0.0_amd64.deb libthrift-0.9.3_0.9.3-2_amd64.deb redis-server_3.0.7-2_amd64.deb redis-tools_3.0.7-2_amd64.deb p4-bmv2_1.0.0_amd64.deb p4-switch_1.0.0_amd64.deb)
|
||||
target/docker-sonic-p4.gz: target/docker-base.gz $(addprefix dockers/docker-sonic-p4/deps/,libswsscommon_1.0.0_amd64.deb libhiredis0.13_0.13.3-2_amd64.deb quagga_0.99.24.1-2_amd64.deb syncd_1.0.0_amd64.deb swss_1.0.0_amd64.deb libsairedis_1.0.0_amd64.deb libsaimetadata_1.0.0_amd64.deb libthrift-0.9.3_0.9.3-2_amd64.deb redis-server_$(REDIS_VERSION).deb redis-tools_$(REDIS_VERSION).deb p4-bmv2_1.0.0_amd64.deb p4-switch_1.0.0_amd64.deb)
|
||||
docker load < $<
|
||||
$(call build_docker,$(patsubst target/%.gz,%,$@),$@)
|
||||
|
||||
|
@ -1,10 +1,13 @@
|
||||
FROM docker-base
|
||||
|
||||
## Pre-install the fundamental packages
|
||||
COPY ["deps/redis-tools_*.deb", "deps/redis-server_*.deb", "/deps/"]
|
||||
|
||||
## Install packages
|
||||
## Clean up
|
||||
RUN apt-get -y install \
|
||||
redis-server \
|
||||
&& \
|
||||
RUN apt-get update && \
|
||||
dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; }; \
|
||||
dpkg_apt /deps/redis-tools_*.deb && \
|
||||
dpkg_apt /deps/redis-server_*.deb && \
|
||||
apt-get clean -y && apt-get autoclean -y && apt-get autoremove -y
|
||||
|
||||
RUN sed -ri 's/^daemonize yes$/daemonize no/' /etc/redis/redis.conf \
|
||||
|
@ -3,6 +3,8 @@
|
||||
.ONESHELL:
|
||||
SHELL := /bin/bash
|
||||
|
||||
REDIS_VERSION=3.2.4-1~bpo8+1_amd64
|
||||
|
||||
## Function: build_project, directory
|
||||
## Build the project and save the .deb target in the same directory
|
||||
## TRICK: clean dh state so it will force recreating .deb later
|
||||
@ -25,10 +27,10 @@ libnl-%.deb:
|
||||
libteam5_1.26-1_amd64.deb libteam-dev_1.26-1_amd64.deb libteam-utils_1.26-1_amd64.deb libteamdctl0_1.26-1_amd64.deb: libnl-%.deb
|
||||
pushd libteam; ./build.sh; popd
|
||||
|
||||
redis-server_3.0.7-2_amd64.deb redis-tools_3.0.7-2_amd64.deb redis-sentinel_3.0.7-2_amd64.deb:
|
||||
redis-sentinel_$(REDIS_VERSION).deb redis-$(REDIS_VERSION).deb redis-tools_$(REDIS_VERSION).deb:
|
||||
pushd redis; ./build.sh; popd
|
||||
|
||||
libhiredis0.13_0.13.3-2_amd64.deb libhiredis-dbg_0.13.3-2_amd64.deb libhiredis-dev_0.13.3-2_amd64.deb: redis-server_3.0.7-2_amd64.deb redis-tools_3.0.7-2_amd64.deb redis-sentinel_3.0.7-2_amd64.deb
|
||||
libhiredis0.13_0.13.3-2_amd64.deb libhiredis-dbg_0.13.3-2_amd64.deb libhiredis-dev_0.13.3-2_amd64.deb: redis-server_$(REDIS_VERSION).deb redis-tools_$(REDIS_VERSION).deb redis-sentinel_$(REDIS_VERSION).deb
|
||||
pushd hiredis; ./build.sh; popd
|
||||
|
||||
libthrift-0.9.3_0.9.3-2_amd64.deb libthrift-dev_0.9.3-2_amd64.deb python-thrift_0.9.3-2_amd64.deb thrift-compiler_0.9.3-2_amd64.deb:
|
||||
@ -58,7 +60,7 @@ p4-switch_1.0.0_amd64.deb: thrift-compiler_0.9.3-2_amd64.deb python-thrift_0.9.3
|
||||
quagga_0.99.24.1-2.1_amd64.deb:
|
||||
$(call build_project, sonic-quagga)
|
||||
|
||||
libswsscommon_1.0.0_amd64.deb libswsscommon-dev_1.0.0_amd64.deb: redis-server_3.0.7-2_amd64.deb redis-tools_3.0.7-2_amd64.deb libhiredis0.13_0.13.3-2_amd64.deb libhiredis-dev_0.13.3-2_amd64.deb
|
||||
libswsscommon_1.0.0_amd64.deb libswsscommon-dev_1.0.0_amd64.deb: redis-server_$(REDIS_VERSION).deb redis-tools_$(REDIS_VERSION).deb libhiredis0.13_0.13.3-2_amd64.deb libhiredis-dev_0.13.3-2_amd64.deb
|
||||
$(foreach dep, $^, $(call install_deb, $(dep)))
|
||||
$(call build_project, sonic-swss-common)
|
||||
|
||||
|
@ -1,14 +1,11 @@
|
||||
#!/bin/bash -x
|
||||
|
||||
export REDIS_DOWNLOAD_URL=http://http.debian.net/debian/pool/main/r/redis/redis_3.0.7.orig.tar.gz
|
||||
export REDIS_PACKAGING_URL=http://http.debian.net/debian/pool/main/r/redis/redis_3.0.7-2.debian.tar.xz
|
||||
wget -N 'http://mirrors.accretive-networks.net/debian/pool/main/r/redis/redis_3.2.4.orig.tar.gz'
|
||||
wget -N 'http://mirrors.accretive-networks.net/debian/pool/main/r/redis/redis_3.2.4-1~bpo8+1.dsc'
|
||||
wget -N 'http://mirrors.accretive-networks.net/debian/pool/main/r/redis/redis_3.2.4-1~bpo8+1.debian.tar.xz'
|
||||
|
||||
wget -O redis_3.0.7-2.dsc 'https://sonicstorage.blob.core.windows.net/packages/redis_3.0.7-2.dsc?sv=2015-04-05&sr=b&sig=evQtsWTIUFlgWbzLLifS1lDgop%2BzlqIP8ehZl3p%2FCKI%3D&se=2026-07-24T01%3A48%3A19Z&sp=r'
|
||||
wget -O redis_3.0.7.orig.tar.gz 'https://sonicstorage.blob.core.windows.net/packages/redis_3.0.7.orig.tar.gz?sv=2015-04-05&sr=b&sig=0ht16%2Fi8%2FPZQHp1PrDPYW0iRwcLfUPw1JpKUapizu8o%3D&se=2026-07-24T01%3A48%3A49Z&sp=r'
|
||||
wget -O redis_3.0.7-2.debian.tar.xz 'https://sonicstorage.blob.core.windows.net/packages/redis_3.0.7-2.debian.tar.xz?sv=2015-04-05&sr=b&sig=4a33ECTvURfNUEDkS436ZlSsIpLIC9QdJrBBRIoWpW0%3D&se=2026-07-24T01%3A49%3A22Z&sp=r'
|
||||
dpkg-source -x redis_3.2.4-1~bpo8+1.dsc
|
||||
|
||||
dpkg-source -x redis_3.0.7-2.dsc
|
||||
|
||||
pushd redis-3.0.7; fakeroot debian/rules binary; popd
|
||||
pushd redis-3.2.4; fakeroot debian/rules binary; popd
|
||||
|
||||
cp *.deb ..
|
||||
|
Loading…
Reference in New Issue
Block a user