[英]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.