From 569b8b4e59b8b781a25cf1637536796fe4ae6184 Mon Sep 17 00:00:00 2001 From: Nuwan Goonasekera <2070605+nuwang@users.noreply.github.com> Date: Tue, 24 Aug 2021 21:58:50 +0530 Subject: [PATCH 1/3] Use env var when performing chown in k8s docker --- .k8s_ci.Dockerfile | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.k8s_ci.Dockerfile b/.k8s_ci.Dockerfile index 9a3a4addc64..f6c7b8dca6f 100644 --- a/.k8s_ci.Dockerfile +++ b/.k8s_ci.Dockerfile @@ -18,11 +18,8 @@ ARG ROOT_DIR=/galaxy ARG SERVER_DIR=$ROOT_DIR/server -# For much faster build time override this with image0 (Dockerfile.0 build): -# docker build --build-arg BASE=... ARG STAGE1_BASE=python:3.7-slim ARG FINAL_STAGE_BASE=$STAGE1_BASE -# NOTE: the value of GALAXY_USER must be also hardcoded in COPY in final stage ARG GALAXY_USER=galaxy ARG GALAXY_PLAYBOOK_REPO=https://github.com/galaxyproject/galaxy-docker-k8s @@ -153,9 +150,9 @@ RUN set -xe; \ WORKDIR $ROOT_DIR # Copy galaxy files to final image -# The chown value MUST be hardcoded (see #35018 at github.com/moby/moby) -COPY --chown=galaxy:galaxy --from=server_build $ROOT_DIR . -COPY --chown=galaxy:galaxy --from=client_build $SERVER_DIR/static ./server/static +# The chown value MUST be hardcoded (see https://github.com/moby/moby/issues/35018) +COPY --chown=$GALAXY_USER:$GALAXY_USER --from=server_build $ROOT_DIR . +COPY --chown=$GALAXY_USER:$GALAXY_USER --from=client_build $SERVER_DIR/static ./server/static WORKDIR $SERVER_DIR EXPOSE 8080 From 3cef0995ae6997ec4ec7d07b97197fcf854f0835 Mon Sep 17 00:00:00 2001 From: Nuwan Goonasekera <2070605+nuwang@users.noreply.github.com> Date: Tue, 24 Aug 2021 21:59:10 +0530 Subject: [PATCH 2/3] Allow use of backspace in k8s docker vim --- .k8s_ci.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.k8s_ci.Dockerfile b/.k8s_ci.Dockerfile index f6c7b8dca6f..6aed9c8ff55 100644 --- a/.k8s_ci.Dockerfile +++ b/.k8s_ci.Dockerfile @@ -136,7 +136,7 @@ RUN set -xe; \ bzip2 \ && update-alternatives --install /usr/bin/nano nano /bin/nano-tiny 0 \ && update-alternatives --install /usr/bin/vim vim /usr/bin/vim.tiny 0 \ - && echo "set nocompatible" >> /usr/share/vim/vimrc.tiny \ + && echo "set nocompatible\nset backspace=indent,eol,start" >> /usr/share/vim/vimrc.tiny \ && echo "$LANG UTF-8" > /etc/locale.gen \ && locale-gen $LANG && update-locale LANG=$LANG \ && apt-get autoremove -y && apt-get clean \ From 37c554b28320aaf871dae83b91789596742b5840 Mon Sep 17 00:00:00 2001 From: Nuwan Goonasekera <2070605+nuwang@users.noreply.github.com> Date: Tue, 24 Aug 2021 21:59:28 +0530 Subject: [PATCH 3/3] Change entrypoint to tini in k8s docker --- .k8s_ci.Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.k8s_ci.Dockerfile b/.k8s_ci.Dockerfile index 6aed9c8ff55..f8419531551 100644 --- a/.k8s_ci.Dockerfile +++ b/.k8s_ci.Dockerfile @@ -134,6 +134,7 @@ RUN set -xe; \ procps \ less \ bzip2 \ + tini \ && update-alternatives --install /usr/bin/nano nano /bin/nano-tiny 0 \ && update-alternatives --install /usr/bin/vim vim /usr/bin/vim.tiny 0 \ && echo "set nocompatible\nset backspace=indent,eol,start" >> /usr/share/vim/vimrc.tiny \ @@ -161,5 +162,7 @@ USER $GALAXY_USER ENV PATH="$SERVER_DIR/.venv/bin:${PATH}" ENV GALAXY_CONFIG_CONDA_AUTO_INIT=False +ENTRYPOINT ["tini", "--"] + # [optional] to run: CMD uwsgi --yaml config/galaxy.yml