Skip to content

Commit

Permalink
Debug docker
Browse files Browse the repository at this point in the history
  • Loading branch information
svenklemm committed Feb 11, 2025
1 parent a6b0d22 commit e48a178
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ on:
push:
branches: [ release_docker, dev-build ]
pull_request:
paths: .github/workflows/docker-image.yml
workflow_dispatch:
inputs:
version:
Expand Down Expand Up @@ -54,6 +53,7 @@ jobs:
if [ "${{ github.event_name }}" == "pull_request" ]
then
export ORG=timescaledev
export BETA=1
fi
if [ "${{ github.event.inputs.no_tag_latest }}" == "true" ]
then
Expand Down
47 changes: 25 additions & 22 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ ARG ALPINE_VERSION
############################
# Build tools binaries in separate image
############################
ARG GO_VERSION=1.22.4
FROM golang:${GO_VERSION}-alpine AS tools

ENV TOOLS_VERSION 0.8.1

RUN apk update && apk add --no-cache git gcc musl-dev \
&& go install github.com/timescale/timescaledb-tune/cmd/timescaledb-tune@latest \
&& go install github.com/timescale/timescaledb-parallel-copy/cmd/timescaledb-parallel-copy@latest
# ARG GO_VERSION=1.22.4
# FROM golang:${GO_VERSION}-alpine AS tools
#
# ENV TOOLS_VERSION 0.8.1
#
# RUN apk update && apk add --no-cache git gcc musl-dev \
# && go install github.com/timescale/timescaledb-tune/cmd/timescaledb-tune@latest \
# && go install github.com/timescale/timescaledb-parallel-copy/cmd/timescaledb-parallel-copy@latest

############################
# Grab old versions from previous version
Expand Down Expand Up @@ -45,19 +45,21 @@ ARG PGVECTOR_VERSION
ARG PG_VERSION
ARG CLANG_VERSION
RUN set -ex; \
apk update; \
apk add --no-cache --virtual .vector-deps \
postgresql${PG_VERSION}-dev \
git \
build-base \
clang${CLANG_VERSION} \
llvm${CLANG_VERSION}-dev \
llvm${CLANG_VERSION}; \
git clone --branch ${PGVECTOR_VERSION} https://github.com/pgvector/pgvector.git /build/pgvector; \
cd /build/pgvector; \
make; \
make install; \
apk del .vector-deps;
if [ "$PG_MAJOR_VERSION" -ge 16 ] && [ "$TARGETARCH" != "arm" ]; then \
apk update; \
apk add --no-cache --virtual .vector-deps \
postgresql${PG_VERSION}-dev \
git \
build-base \
clang${CLANG_VERSION} \
llvm${CLANG_VERSION}-dev \
llvm${CLANG_VERSION}; \
git clone --branch ${PGVECTOR_VERSION} https://github.com/pgvector/pgvector.git /build/pgvector; \
cd /build/pgvector; \
make; \
make install; \
apk del .vector-deps; \
fi

# install pgai only on pg16+ and not on 32 bit arm
ARG PGAI_VERSION
Expand Down Expand Up @@ -100,9 +102,10 @@ RUN set -ex; \
fi

COPY docker-entrypoint-initdb.d/* /docker-entrypoint-initdb.d/
COPY --from=tools /go/bin/* /usr/local/bin/
# COPY --from=tools /go/bin/* /usr/local/bin/
COPY --from=oldversions /usr/local/lib/postgresql/timescaledb-*.so /usr/local/lib/postgresql/
COPY --from=oldversions /usr/local/share/postgresql/extension/timescaledb--*.sql /usr/local/share/postgresql/extension/
COPY --from=oldversions /usr/local/bin/timescaledb-* /usr/local/bin/

ARG TS_VERSION
RUN set -ex \
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ NAME=timescaledb
# Default is to timescaledev to avoid unexpected push to the main repo
# Set ORG to timescale in the caller
ORG=timescaledev
PG_VER=pg16
PG_VER=pg17
PG_VER_NUMBER=$(shell echo $(PG_VER) | cut -c3-)
PG_MAJOR_VERSION=$(shell echo $(PG_VER_NUMBER) | cut -d. -f1)
ifeq ($(shell test $(PG_MAJOR_VERSION) -ge 16; echo $$?),0)
Expand All @@ -18,7 +18,10 @@ PREV_TS_IMAGE="timescale/timescaledb:$(PREV_TS_VERSION)-pg$(PG_VER_NUMBER)$(PREV
PREV_IMAGE=$(shell if docker pull $(PREV_TS_IMAGE) >/dev/null; then echo "$(PREV_TS_IMAGE)"; else echo "postgres:$(PG_VER_NUMBER)-alpine"; fi )
# Beta releases should not be tagged as latest, so BETA is used to track.
BETA=$(findstring rc,$(TS_VERSION))
#PLATFORM=linux/amd64,linux/arm/v6,linux/arm/v7
PLATFORM=linux/amd64
PLATFORM=linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64
PLATFORM=linux/arm64

# PUSH_MULTI can be set to nothing for dry-run without pushing during multi-arch build
PUSH_MULTI=--push
Expand Down

0 comments on commit e48a178

Please sign in to comment.