Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot build & push additional image tags #16

Closed
cboettig opened this issue Sep 20, 2022 · 2 comments
Closed

cannot build & push additional image tags #16

cboettig opened this issue Sep 20, 2022 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@cboettig
Copy link
Member

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
Copy link
Member

eitsupi commented Sep 21, 2022

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.

{
"r-ver": {
"base-image": "docker.io/rocker/r-ver",
"variants": {
"4.2": {
"tags": [
"ghcr.io/rocker-org/devcontainer/r-ver:4.2",
"ghcr.io/rocker-org/devcontainer/r-ver:4"
],
"platforms": [
"linux/amd64",
"linux/arm64"
]
},
"4.1": {
"tags": [
"ghcr.io/rocker-org/devcontainer/r-ver:4.1"
],
"platforms": [
"linux/amd64",
"linux/arm64"
]
}
}
},
"tidyverse": {
"base-image": "docker.io/rocker/tidyverse",
"variants": {
"4.2": {
"tags": [
"ghcr.io/rocker-org/devcontainer/tidyverse:4.2",
"ghcr.io/rocker-org/devcontainer/tidyverse:4"
],
"platforms": [
"linux/amd64"
]
},
"4.1": {
"tags": [
"ghcr.io/rocker-org/devcontainer/tidyverse:4.1"
],
"platforms": [
"linux/amd64"
]
}
}
}
}

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.

@eitsupi eitsupi added the documentation Improvements or additions to documentation label Sep 21, 2022
@cboettig
Copy link
Member Author

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants