Skip to content

Commit

Permalink
updated admin/ requirements build process to write output files locally
Browse files Browse the repository at this point in the history
  • Loading branch information
zenmonkeykstop committed Aug 5, 2020
1 parent f1b495e commit 2df3de2
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
4 changes: 2 additions & 2 deletions admin/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# debian:stretch 2019-01-22
FROM debian@sha256:21ac5961a3038a839f6fa92ec4583c90f9eb6ca8f580598cde19d35d0f4d8fa6
# debian:buster 2020-08-04
FROM debian@sha256:1e74c92df240634a39d050a5e23fb18f45df30846bb222f543414da180b47a5d
ARG USER_NAME
ENV USER_NAME ${USER_NAME:-root}
ARG USER_ID
Expand Down
12 changes: 10 additions & 2 deletions admin/bin/dev-shell
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ function docker_image() {
local out
out="$(mktemp)"
cd "${TOPLEVEL}"
if ! docker build ${DOCKER_BUILD_ARGUMENTS:-} -t securedrop-admin -f admin/Dockerfile . >& "$out" ; then
if ! docker build \
--build-arg=USER_ID="$(id -u)" \
--build-arg=USER_NAME="${USER:-root}" \
${DOCKER_BUILD_ARGUMENTS:-} -t securedrop-admin -f admin/Dockerfile . >& "$out" ; then
cat "$out"
status=1
else
Expand All @@ -23,7 +26,12 @@ function docker_image() {
}

function docker_run() {
docker run --rm -ti ${DOCKER_RUN_ARGUMENTS:-} securedrop-admin "$@"
docker run \
--rm \
--user "${USER:-root}" \
--volume "${TOPLEVEL}:/sd-root" \
--workdir "/sd-root/admin" \
-ti ${DOCKER_RUN_ARGUMENTS:-} securedrop-admin "$@"
}

docker_image
Expand Down
1 change: 1 addition & 0 deletions admin/requirements-dev.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ flake8
flaky
mock
pbr
pip==19.1
pip-tools>=4.0.0
pylint
pytest
Expand Down
3 changes: 3 additions & 0 deletions admin/requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ wrapt==1.10.11 \
# via astroid

# The following packages are considered to be unsafe in a requirements file:
pip==19.1 \
--hash=sha256:8f59b6cf84584d7962d79fd1be7a8ec0eb198aa52ea864896551736b3614eee9 \
--hash=sha256:d9137cb543d8a4d73140a3282f6d777b2e786bb6abb8add3ac5b6539c82cd624
setuptools==46.0.0 \
--hash=sha256:2f00f25b780fbfd0787e46891dcccd805b08d007621f24629025f48afef444b5 \
--hash=sha256:693e0504490ed8420522bf6bc3aa4b0da6a9f1c80c68acfb4e959275fd04cd82 \
Expand Down

0 comments on commit 2df3de2

Please sign in to comment.