簡體   English   中英

從容器內部構建並推送docker映像

[英]Building and pushing a docker image from inside a container

上下文:我正在使用repo2docker構建包含實驗的映像,然后將其推送到私有注冊表。

我dockerizing這整個管道(克隆實驗的代碼,建築形象,推)與docker-compose

這是我嘗試的:

FROM ubuntu:latest

RUN apt-get update && apt-get install -y python3-pip python3-dev git apt-transport-https ca-certificates curl software-properties-common

RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
RUN add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
RUN apt-get update && apt-get install docker-ce --yes
RUN service docker start

# more setup

ENTRYPOINT rqworker -c settings image_build_queue

然后,我將作業傳遞給rqworker(rqworker部分運行良好)。

但是docker不在我的容器中啟動。 因此,我無法登錄到注冊表,也無法生成映像。

(請注意,我需要運行docker ,但不需要運行容器。)

解決方案是共享主機的Docker套接字,因此構建實際上發生在主機上。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM