question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Customize spilo image

See original GitHub issue

I want to customize spilo base image but because it’s minimal and gets extracted on runtime I can not run commands like apt-get when running docker build with registry.opensource.zalan.do/acid/spilo-10:latest as base image. Docs seems to be old and running build.sh tries to install every postgres version. So how should I customize this image?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ghostcommented, Feb 12, 2018

Running

➜  postgres-appliance git:(master) ✗ ./build.sh --build-arg COMPRESS=false --build-arg PGOLDVERSIONS="" -t spilo-96 .
Sending build context to Docker daemon  6.398MB
Step 1/15 : FROM ubuntu:16.04
 ---> 0458a4468cbc
Step 2/15 : MAINTAINER Alexander Kukushkin <alexander.kukushkin@zalando.de>
 ---> Using cache
 ---> 8adddc88fe98
Step 3/15 : ARG DEMO=false
 ---> Using cache
 ---> d7db00340ffe
Step 4/15 : ENV DEMO $DEMO
 ---> Using cache
 ---> f78d0e335668
Step 5/15 : RUN export DEBIAN_FRONTEND=noninteractive     && apt-get purge -y --allow-remove-essential systemd     && echo 'APT::Install-Recommends "0";' > /etc/apt/apt.conf.d/01norecommend     && echo 'APT::Install-Suggests "0";' >> /etc
/apt/apt.conf.d/01norecommend     && apt-get update     && apt-get upgrade -y     && apt-get install -y curl ca-certificates less locales jq vim-tiny     && if [ "$DEMO" != "true" ]; then         apt-get install -y cron                 pv
 lzop         && ETCDVERSION=2.3.8         && curl -L https://github.com/coreos/etcd/releases/download/v${ETCDVERSION}/etcd-v${ETCDVERSION}-linux-amd64.tar.gz                 | tar xz -C /bin --strip=1 --wildcards --no-anchored etcdctl et
cd;     fi     && localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8     && DISTRIB_CODENAME=$(sed -n 's/DISTRIB_CODENAME=//p' /etc/lsb-release)     && echo "deb http://apt.postgresql.org/pub/repos/apt/ ${DISTRIB
_CODENAME}-pgdg main" > /etc/apt/sources.list.d/pgdg.list     && echo "deb-src http://apt.postgresql.org/pub/repos/apt/ ${DISTRIB_CODENAME}-pgdg main" >> /etc/apt/sources.list.d/pgdg.list     && curl -s -o - https://www.postgresql.org/med
ia/keys/ACCC4CF8.asc | apt-key add -     && apt-get update     && apt-get install -y postgresql-common     && sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf     && apt-get clean     && rm -rf 
/var/lib/apt/lists/*             /var/cache/debconf/*             /usr/share/doc             /usr/share/man             /usr/share/locale/??             /usr/share/locale/??_??     && find /var/log -type f -exec truncate --size 0 {} \;   
  && find /usr/share/i18n/charmaps/ -type f ! -name UTF-8.gz -delete     && find /usr/share/i18n/locales/ -type f ! -name en_US -delete     && echo 'en_US.UTF-8 UTF-8' > /usr/share/i18n/SUPPORTED
 ---> Using cache
 ---> 966668a76568
Step 6/15 : ADD dependencies/debs /builddeps
 ---> Using cache
 ---> f0c49592c79f
Step 7/15 : ARG WITH_PERL=false
 ---> Using cache
 ---> dc3d28ff92c2
Step 8/15 : ARG PGOLDVERSIONS="9.3 9.4 9.5 9.6"
 ---> Using cache
 ---> 59ff44c8ae90
Step 9/15 : ENV PGVERSION 10 PGOLDVERSIONS "$PGOLDVERSIONS" POSTGIS_VERSION 2.4 BG_MON_COMMIT 57f50fd9b92a9ed3cdb185118fbce27d4d56984c DECODEBUFS_COMMIT d08a75593c68897600e10f5250133337624bcf63 HYPOPG 1.1.0 SET_USER REL1_4_0 PLPGSQL_CHECK
 v1.2.2 PLPROFILER REL3_2 TIMESCALEDB 0.8.0 PGEXTWLIST v1.6 PAM_OAUTH2 v1.0
 ---> Using cache
 ---> b652971ffafc

Ends up with this error:

STRIPPROG='strip --strip-unneeded' /bin/sh /usr/lib/postgresql/10/lib/pgxs/src/makefiles/../../config/install-sh -c -m 755 -s decoderbufs.so '/usr/lib/postgresql/10/lib/decoderbufs.so'
/bin/sh /usr/lib/postgresql/10/lib/pgxs/src/makefiles/../../config/install-sh -c -m 644 .//decoderbufs.control '/usr/share/postgresql/10/extension/'
make[1]: Leaving directory '/builddeps/postgres-decoderbufs-d08a75593c68897600e10f5250133337624bcf63'
make: Leaving directory '/builddeps/postgres-decoderbufs-d08a75593c68897600e10f5250133337624bcf63'
+ [ 10 = 9.3 ]
+ [ 10 = 9.4 ]
+ [ 10 = 9.6 ]
+ [ 10 = 10 ]
+ cd /builddeps/timescaledb
+ rm -fr build
+ ./bootstrap
-- The C compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- TimescaleDB version 0.8.0. Can be updated from version 0.7.1
-- Build type is Release
-- Found Git: /usr/bin/git (found version "2.7.4") 
-- Using pg_config /usr/bin/pg_config
CMake Error at CMakeLists.txt:88 (message):
  Could not parse PostgreSQL version
0reactions
ghostcommented, Feb 13, 2018

@alisabzevari No I didn’t change spilo repository (empty git diff), I just pulled latest commit and ran that command. I guess from docker built -t spilo . you mean docker built -f Dockerfile.build -t spilo ., I can not test it right now but when I created this issue running ./build.sh -t "spilo:squashed" . or some similar command would go beyond this step.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Public / Docker / Zalando Spilo Postgres · GitLab - Star
Images built on top of Zalando's Spilo Postgres images.
Read more >
Administrator - Postgres Operator - Read the Docs
One use case is a customized Spilo image that must be configured by extra environment variables. Another case could be to provide custom...
Read more >
Postgres Operator - Zalando Open Source
The Postgres Operator has been developed at Zalando and is being used in production for over three years. Using Spilo 12 images or...
Read more >
Pre-loading TimescaleDB on Spilo container - Stack Overflow
How do I configure it to preload the timescaledb library? ... of a modified version of the Spilo image with the necessary mods...
Read more >
Spilo Worldwide Mehaz Edge Cutter, 1 ea - Walmart.com
Arrives by Wed, Dec 14 Buy Spilo Worldwide Mehaz Edge Cutter, 1 ea at Walmart.com. ... image 0 of Spilo Worldwide Mehaz Edge...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found