我正在构建一个码头图像,并将其提交到Gitlab的容器注册中心。我想从我所知道的gitlab-ci.yml中推出一个Ubuntu映像:
image: rocker/r-ver:latest
before_script:
- apt-get update && apt-get upgrade -y
- apt-get install tree curl gdebi-core -y
- apt-get install -y --no-install-recommends libxt6
- curl -LO https://quarto.org/download/latest/quarto-linux-amd64.deb
- gdebi --non-interactive quarto-linux-amd64.deb
- quarto install extension --no-prompt quarto-ext/grouped-tabsets
- R -q -e 'install.packages(c("reticulate","vetiver","pins","dplyr","checkmate","quarto","gt","tidymodels"))'
- R -q -e 'reticulate::install_miniconda()'
- R -q -e 'reticulate::conda_create(envname = "sre-wiki", packages = c("python=3.8.13", "numpy"))'
- R -q -e 'reticulate::conda_list()'
- R -e 'write("reticulate::use_condaenv(\"sre-wiki\", required = TRUE)",file=file.path(R.home(),"etc","Rprofile.site"),append=TRUE)'
- R -q -e 'reticulate::conda_install(envname = "sre-wiki", "vetiver", pip = TRUE)'
build image:
image: docker
services:
- docker:20.10.10-dind
script:
- echo $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY $CI_REGISTRY --password-stdin
- docker build -t $CI_REGISTRY_IMAGE .
- docker push $CI_REGISTRY_IMAGE但是,我得到以下信息,因为docker:dind默认使用高寒而不是Ubuntu。
/bin/sh: eval: line 128: apt-get: not found我不想使用高山出于各种原因,并想坚持与ubuntu。我似乎找不到任何地方建议这样做。
发布于 2022-09-23 19:07:47
您可以使用一个ubuntu映像,然后只需在其中安装坞CLI。
要使用随ubuntu的repos附带的docker版本,您可以这样做:
myjob:
# ...
image: "ubuntu"
before_script:
- apt update && apt install -y --no-install-recommends docker.io
- ...或者按照从码头安装说明使用特定的版本。
或者,您可以创建自己安装的ubuntu映像,将其推送到注册表(如dockerhub或gitlab注册表),并将其用作您的image:。
https://stackoverflow.com/questions/73821163
复制相似问题