|
| 1 | +FROM debian:bookworm AS pgloader-builder |
| 2 | + |
| 3 | +ENV DEBIAN_FRONTEND=noninteractive |
| 4 | + |
| 5 | +# Install build dependencies |
| 6 | +RUN apt-get update && apt-get install -y --no-install-recommends \ |
| 7 | + git curl sbcl make unzip ca-certificates \ |
| 8 | + libsqlite3-dev libssl-dev gawk freetds-dev jq \ |
| 9 | + && rm -rf /var/lib/apt/lists/* |
| 10 | + |
| 11 | +# Clone pgloader and build it |
| 12 | +WORKDIR /build |
| 13 | +RUN git clone https://github.com/dimitri/pgloader.git \ |
| 14 | + && cd pgloader \ |
| 15 | + && make |
| 16 | + |
| 17 | +FROM node:22 |
| 18 | +# Install basic development tools |
| 19 | +RUN \ |
| 20 | + echo "deb http://apt.postgresql.org/pub/repos/apt bookworm-pgdg main" > /etc/apt/sources.list.d/pgdg.list && \ |
| 21 | + wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \ |
| 22 | + apt update && \ |
| 23 | + apt install -y less man-db sudo vim jq python-is-python3 python3-virtualenv \ |
| 24 | + locales postgresql-client-16 openssh-server |
| 25 | + |
| 26 | +RUN \ |
| 27 | + touch /.dockerenv && \ |
| 28 | + echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && \ |
| 29 | + locale-gen en_US.UTF-8 && \ |
| 30 | + update-locale ANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 LC_ALL=en_US.UTF-8 |
| 31 | + |
| 32 | +# Ensure default `node` user has access to `sudo` |
| 33 | +ARG USERNAME=node |
| 34 | +RUN \ |
| 35 | + echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \ |
| 36 | + && chmod 0440 /etc/sudoers.d/$USERNAME |
| 37 | + |
| 38 | +# install ops and plugins |
| 39 | +USER node |
| 40 | +RUN \ |
| 41 | + curl -sL https://raw.githubusercontent.com/apache/openserverless-cli/refs/heads/main/install.sh | bash |
| 42 | +RUN \ |
| 43 | + curl -LsSf https://astral.sh/uv/install.sh | sh |
| 44 | + |
| 45 | +ENV PATH="/home/node/.local/bin:${PATH}" |
| 46 | + |
| 47 | +RUN \ |
| 48 | + ops -update |
| 49 | +RUN \ |
| 50 | + git clone https://github.com/apache/openserverless-devcontainer /home/node/.ops/openserverless-devcontainer ;\ |
| 51 | + ln -sf /home/node/.ops/devcontaine/olaris-tk /home/node/olaris-tk |
| 52 | + |
| 53 | +COPY --from=pgloader-builder /build/pgloader/build/bin/pgloader /usr/bin/pgloader |
| 54 | +ADD start-ssh.sh /start-ssh.sh |
| 55 | + |
| 56 | +CMD ["/start-ssh.sh"] |
0 commit comments