rocker-org / devcontainer-images

R Docker images built with Dev Container Features
https://rocker-project.org/images/devcontainer/images.html
MIT License
12 stars 4 forks source link

cannot build & push additional image tags #16

Closed cboettig closed 2 years ago

cboettig commented 2 years ago

It looks like other flavors, e.g. ghcr.io/rocker-org/devcontainer/geospatial:4 don't yet exist. I gave a stab at trying to build these but am just hitting an unexpected error:

SRC_NAME=r-ver IMAGE_NAME=geospatial VARIANT=4.2 DEVCON_BUILD_OPTION=--push make devcontainer
jq: error (at build/args/r-ver.json:48): Cannot iterate over null (null)
jq: error (at build/args/r-ver.json:48): Cannot iterate over null (null)
mkdir -p work/geospatial/4.2
cat src/r-ver/.devcontainer.json | jq '.build.args.VARIANT |= "4.2" | .build.args.BASE_IMAGE |= "null"' >work/geospatial/4.2/.devcontainer.json
mkdir -p work/geospatial/4.2
cp src/r-ver/Dockerfile work/geospatial/4.2/Dockerfile
mkdir -p work/geospatial/4.2/assets/rstudio-prefs.json
cp src/r-ver/assets/rstudio-prefs.json work/geospatial/4.2/assets/rstudio-prefs.json
jq: error (at build/args/r-ver.json:48): Cannot iterate over null (null)
devcontainer build \
--workspace-folder work/geospatial/4.2 \
--platform  \
 \
 \
--push
internal/util.js:279
    throw new ERR_INVALID_ARG_TYPE('original', 'Function', original);
    ^

TypeError [ERR_INVALID_ARG_TYPE]: The "original" argument must be of type function. Received undefined
    at promisify (internal/util.js:279:11)
    at Object.<anonymous> (/usr/local/lib/node_modules/@devcontainers/cli/dist/spec-utils/pfs.js:47:40)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/@devcontainers/cli/dist/spec-common/commonUtils.js:33:15)
    at Module._compile (internal/modules/cjs/loader.js:999:30) {
  code: 'ERR_INVALID_ARG_TYPE'
}
make: *** [Makefile:26: devcontainer] Error 1

Any ideas?

Do you plan on being able to automate the builds of these images like you've done on the rocker-versioned2 stack?

eitsupi commented 2 years ago

Sorry for lack of documentation about the directory structure. The variables are controlled by the following json file, so you cannot select a base image that is not listed here. You must first add them manually.

https://github.com/rocker-org/devcontainer-images/blob/e1775a0031cb5ad6d2cb32b9eeaefa00e0988825/build/args/r-ver.json#L1-L48

BTW, wondering which base image is desired. In microsoft/vscode-dev-containers#1327, rocker/binder was made selectable as a base image because of the desire to use Jupyter.

Do you plan on being able to automate the builds of these images like you've done on the rocker-versioned2 stack?

It is definitely possible, but for now I think a manual update may be sufficient since the file is simple and only holds tags for each minor version and updates occur only once a year.

cboettig commented 2 years ago

Thanks! this all sounds good.

Happy to stick with manual builds.

binder does seem like a sensible one to add (in our case it picks up the rest of the stack so provides a 'batteries included option', particularly having the geospatial libs installed by default is nice). Maybe we just want to add binder and a note in the docs pointing out how this works (so others don't assume as I did that it will recognize an arbitrary r-ver stack image).