externpro / buildpro

build images for projects that use externpro
MIT License
2 stars 1 forks source link

add HOSTPWD #57

Closed smanders closed 10 months ago

smanders commented 11 months ago

from Calvin Bell, 3 Oct 2023

NOT URGENT Hi smanders,

I'm working on docker changes for MicroserviceController. Essentially from within a container, we need access to the pwd of the host machine to add a volume to a new container. (We can go into more detail if you want; just trying to keep it brief)

Here are the changes I'm considering making to CommonLibraries. I would love to hear your thoughts, mistakes I may have made, or alternative solutions.

https://isrhub.usurf.usu.edu/Vantage/CommonLibraries/commit/6f70312ddba12e0ce060c1b86acc5b76a6a001df

smanders commented 10 months ago

in case the commit referenced above ever disappears, the basics of the proposal was to add

# The pwd of the host machine
ARG HOSTPWD
ENV HOSTPWD=${HOSTPWD}

to .devcontainer/centos7-[bld|dev|run].dockerfile, just after timezone TZ

adding

HOSTPWD: ${HOSTPWD}

to .devcontainer/compose.bld.yml just afterTZ: ${TZ}`

and adding

env="${env}\nHOSTPWD=$(pwd)"

to .devcontainer/denv.sh

smanders commented 10 months ago

what they were attempting to do with HOSTPWD was never fully explained

here's the pull that merged to SWAT:development https://isrhub.usurf.usu.edu/SWAT/SWATFramework/pull/484 and the code review for "DockerIntegration" https://isrhub.usurf.usu.edu/cbell/SWATFramework/pull/33

these lines https://isrhub.usurf.usu.edu/SWAT/SWATFramework/blob/9926122629e4ce7fdbc4b111c5a756ec20fe78ca/SwatCore/MicroserviceController/MSContainer.cs#L51-L62 apparently do what they were going to attempt to use HOSTPWD to do, in some way...

smanders commented 10 months ago

closing as "wontfix"