From d926bea1c468987ed1908a6e83e6f8c3c07409f8 Mon Sep 17 00:00:00 2001 From: Nils Dijk Date: Mon, 9 May 2022 15:25:31 +0200 Subject: [PATCH] move dev tools to later layer --- .devcontainer/Dockerfile | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 4c4c5852a..8e44583da 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -4,17 +4,13 @@ FROM ubuntu:22.04 AS base ENV TZ=Europe/Amsterdam RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone -RUN yes | unminimize - +# install build tools RUN apt update && apt install -y \ - autoconf \ bzip2 \ curl \ flex \ gcc \ - gdb \ git \ - htop \ libcurl4-gnutls-dev \ libicu-dev \ libkrb5-dev \ @@ -29,24 +25,20 @@ RUN apt update && apt install -y \ libzstd-dev \ locales \ make \ - man\ pkg-config \ - pspg \ python3 \ python3-pip \ sudo \ uuid-dev \ - vim \ zlib1g-dev \ && apt clean RUN locale-gen en_US.UTF-8 -# allow all sudoers to login without a password prompt -RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers - -RUN useradd -ms /bin/bash citus -RUN usermod -aG sudo citus +# add the citus user to sudoers and allow all sudoers to login without a password prompt +RUN useradd -ms /bin/bash citus \ + && usermod -aG sudo citus \ + && echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers WORKDIR /home/citus USER citus @@ -111,12 +103,24 @@ RUN cmake .. RUN make -sj8 RUN make install DESTDIR=/uncrustify -RUN echo "cachebuster" -RUN tree /uncrustify/usr # assemble the final container by copying over the artifacts from separately build containers FROM base AS devcontainer +RUN yes | sudo unminimize + +# install developer productivity tools +RUN sudo apt update \ + && sudo apt install -y \ + autoconf \ + bash-completion \ + gdb \ + htop \ + man \ + pspg \ + vim \ + && sudo apt clean + COPY --from=pg12 /home/citus/.pgenv-staging/ /home/citus/.pgenv/ COPY --from=pg13 /home/citus/.pgenv-staging/ /home/citus/.pgenv/ COPY --from=pg14 /home/citus/.pgenv-staging/ /home/citus/.pgenv/