From f1138175a31b76c830034ec97c36fa7d72c0a277 Mon Sep 17 00:00:00 2001 From: "Lindsley, Chris" Date: Sun, 27 Aug 2023 08:39:43 -0400 Subject: [PATCH] add user to docker container --- CHANGELOG.md | 6 ++++++ Dockerfile | 5 +++++ Makefile | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 536845b..2e25b82 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # CHANGELOG +## Unreleased + +* Update build Dockerfile to create an entry in /etc/passwd for the user building + the image. It allows the `setup_jwt_cookie.sh` script to be run inside the + container. + ## v17.0.0.0 * Upgrade to [Cumulus v17.0.0](https://github.com/nasa/cumulus/releases/tag/v17.0.0) * Upgrade terraform modules to use AWS provider version 5.0 diff --git a/Dockerfile b/Dockerfile index f547d83..7a93981 100644 --- a/Dockerfile +++ b/Dockerfile @@ -41,6 +41,11 @@ RUN \ curl "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/linux_64bit/session-manager-plugin.rpm" -o "session-manager-plugin.rpm" &&\ yum install -y session-manager-plugin.rpm +# Add user to /etc/passwd for keygen in Makefile +ARG USER +RUN \ + echo "user:x:${USER}:0:root:/:/bin/bash" >> /etc/passwd + WORKDIR /CIRRUS-core # Python38 target diff --git a/Makefile b/Makefile index b0aa733..0f472db 100644 --- a/Makefile +++ b/Makefile @@ -48,7 +48,7 @@ endef # --------------------------- .PHONY: image image: Dockerfile - docker build -f Dockerfile --no-cache -t cirrus-core:$(DOCKER_TAG) --target $(PYTHON_VER) . + docker build -f Dockerfile --no-cache -t cirrus-core:$(DOCKER_TAG) --target $(PYTHON_VER) --build-arg USER=`id -u` . .PHONY: container-shell container-shell: