在Dockerfile中运行Docker pull命令

Dud*_*i95 5 docker dockerfile

我是Docker的新手并尝试了一些事情.现在我想创建一个Dockerfile,它自动构建Oracle DB映像.

############################################################
# Dockerfile to build MongoDB container images
# Based on Ubuntu
############################################################

# Set the base image to Ubuntu
FROM ubuntu

# File Author / Maintainer
MAINTAINER Example McAuthor

# Update the repository sources list
RUN apt-get update

################## BEGIN INSTALLATION #####################
CMD docker pull alexeiled/docker-oracle-xe-11g
Run Code Online (Sandbox Code Playgroud)

我的问题是docker pull命令.
当我尝试使用该RUN命令时,docker守护程序说,他找不到' docker'.然后我使用CMD命令,它可以工作,但这是正确的吗?也许你可以告诉我其他方法.

Von*_*onC 6

你不应该从Dockerfile中提取.

您只需使用以下命令启动Dockerfile即可:

FROM docker-oracle-xe-11g
Run Code Online (Sandbox Code Playgroud)

并在其中添加您在自己的Oracle映像中需要的任何Oracle配置文件.
docker-oracle-xe-11gDockerfile已经基于Ubuntu.

FROM ubuntu:14.04.1
Run Code Online (Sandbox Code Playgroud)

  • 是的,我知道这可行,但我希望我可以通过 dockerfile 触发它......因为我必须在几台电脑上推出它 (2认同)