1

Is there a way to change the WORKDIR to the first pattern matched folder? something like

SHELL ["/bin/bash", "-c"]
RUN pattern=mypattern*
RUN files=( $pattern )
WORKDIR $files

Unlike my local terminal behaviour the files variable remains empty, eventhough the current WORKDIR is correct and the folder most certainly exists based on docker buil logs.

EDIT: for clarification, the use case is:

There is a Go package (lilliput) which comes with prebuilt binaries, but these binaries don't work on the platform our docker imagine will be running on. Thankfully this package provides a build_deps.sh for such cases, but this has to be executed from the package installation folder. This folder will have a arbitrary name based on the package release version (eg lilliput@v0.0.0-20210720001558-e1547514bd5f ) The Goal is to pattern match this folder and lilliput*, switch the WORKDIR and start the dependency build there.

1 Answers1

0

you can try to use ENV variables, or args on buiild docker file

  • thanks but this doesnt really solve the issue as i am changing WORKDIR to compile some binaries for an extrenal Golang Package which might end up under `packagenamev23o4h2u3hr9h34hr92h3792h3` depending on the release – ObnoxiouslyRetarded Aug 05 '21 at 12:17