Skip to content

Commit 57d32dc

Browse files
author
lijianguo
committed
chore(dockerfile): use drycc/base image
1 parent 5ffa541 commit 57d32dc

4 files changed

Lines changed: 41 additions & 33 deletions

File tree

Dockerfile

Lines changed: 38 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,44 @@
1-
FROM docker.io/minio/mc:latest as mc
1+
FROM docker.io/drycc/base:bullseye
22

3-
4-
FROM docker.io/library/golang:buster as builder
5-
ARG GOBIN=/usr/local/bin
6-
ARG WAL_G_VERSION=v1.1
7-
8-
RUN apt-get update \
9-
&& apt-get install -y git gcc liblzo2-dev cmake \
10-
&& git clone --dept 1 -b $WAL_G_VERSION https://github.com/wal-g/wal-g $GOPATH/src/github.com/wal-g/wal-g \
11-
&& cd $GOPATH/src/github.com/wal-g/wal-g \
12-
&& make install \
13-
&& make deps \
14-
&& make pg_install
15-
16-
17-
FROM docker.io/library/postgres:14-bullseye
18-
19-
COPY rootfs /
20-
COPY --from=mc /usr/bin/mc /bin/mc
21-
COPY --from=builder /usr/local/bin/wal-g /bin/wal-g
22-
23-
ENV PGDATA $PGDATA/$PG_MAJOR
3+
ENV PGDATA /opt/drycc/postgresql/14/data
244
ENV WALG_ENVDIR /etc/wal-g.d/env
255

26-
RUN mkdir -p $WALG_ENVDIR \
27-
&& apt-get update \
28-
&& apt-get install -y --no-install-recommends \
29-
jq \
30-
python3 \
31-
ca-certificates \
32-
python3-pip \
33-
&& pip3 install envdir
6+
COPY rootfs/bin /bin/
7+
COPY rootfs/docker-entrypoint-initdb.d /docker-entrypoint-initdb.d/
8+
COPY rootfs/docker-entrypoint.sh /docker-entrypoint.sh
9+
ENV JQ_VERSION="1.6" \
10+
GOSU_VERSION="1.14" \
11+
MC_VERSION="2022.02.26.03.58.31" \
12+
WAL_G_VERSION="1.1" \
13+
PYTHON_VERSION="3.10.2" \
14+
POSTGRESQL_VERSION="14.2"
3415

16+
RUN mkdir -p $WALG_ENVDIR \
17+
&& install-stack jq $JQ_VERSION \
18+
&& install-stack gosu $GOSU_VERSION \
19+
&& install-stack mc $MC_VERSION \
20+
&& install-stack wal-g $WAL_G_VERSION \
21+
&& install-stack python $PYTHON_VERSION \
22+
&& install-stack postgresql $POSTGRESQL_VERSION && . init-stack \
23+
&& rm -rf \
24+
/usr/share/doc \
25+
/usr/share/man \
26+
/usr/share/info \
27+
/usr/share/locale \
28+
/var/lib/apt/lists/* \
29+
/var/log/* \
30+
/var/cache/debconf/* \
31+
/etc/systemd \
32+
/lib/lsb \
33+
/lib/udev \
34+
/usr/lib/`echo $(uname -m)`-linux-gnu/gconv/IBM* \
35+
/usr/lib/`echo $(uname -m)`-linux-gnu/gconv/EBC* \
36+
&& mkdir -p /usr/share/man/man{1..8} \
37+
&& mkdir -p /run/postgresql $PGDATA \
38+
&& groupadd postgres && useradd -g postgres postgres \
39+
&& chown -R postgres:postgres /run/postgresql $PGDATA \
40+
&& set -eux; pip3 install --disable-pip-version-check --no-cache-dir envdir 2>/dev/null
41+
42+
ENTRYPOINT ["init-stack"]
3543
CMD ["/docker-entrypoint.sh", "postgres"]
3644
EXPOSE 5432

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ SHELL_SCRIPTS = $(wildcard _scripts/*.sh contrib/ci/*.sh rootfs/bin/*)
1414
# The following variables describe the containerized development environment
1515
# and other build options
1616
DEV_ENV_IMAGE := ${DEV_REGISTRY}/drycc/go-dev
17-
DEV_ENV_WORK_DIR := /go/src/${REPO_PATH}
17+
DEV_ENV_WORK_DIR := /opt/drycc/go/src/${REPO_PATH}
1818
DEV_ENV_CMD := docker run --rm -v ${CURDIR}:${DEV_ENV_WORK_DIR} -w ${DEV_ENV_WORK_DIR} ${DEV_ENV_IMAGE}
1919
DEV_ENV_CMD_INT := docker run -it --rm -v ${CURDIR}:${DEV_ENV_WORK_DIR} -w ${DEV_ENV_WORK_DIR} ${DEV_ENV_IMAGE}
2020

contrib/ci/test-minio.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ echo "1234567890123456789012345678901234567890" > "${CURRENT_DIR}"/tmp/aws-user/
2626

2727
# boot minio
2828
mkdir -p "${CURRENT_DIR}"/tmp/bin
29-
echo "ls /data/*/*/basebackups_005" > "${CURRENT_DIR}"/tmp/bin/backups.sh
29+
echo "ls /data/*/basebackups_005" > "${CURRENT_DIR}"/tmp/bin/backups.sh
3030
MINIO_JOB=$(docker run -d \
3131
-v "${CURRENT_DIR}"/tmp/bin:/tmp/bin \
3232
-v "${CURRENT_DIR}"/tmp/aws-user:/var/run/secrets/drycc/objectstore/creds \

contrib/ci/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,5 @@ check-postgres() {
4141

4242
# check if postgres is running
4343
puts-step "checking if postgres is running"
44-
docker exec "$1" is_running
44+
docker exec "$1" init-stack is_running
4545
}

0 commit comments

Comments
 (0)