Running Docker pull command in Dockerfile

I am new to Docker and trying some things. Now I want to create a Dockerfile, which build automatically the Oracle DB image.

############################################################
# 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

My problem is the docker pull command.
When I try to use the RUN command, the docker daemon say, that he can’t find ‘docker‘. Then I use the CMD command, and it works, but is that correct? Maybe you can show me alternative ways.

  • How to enable SSL in docker with nginx hosted in Ubuntu
  • Running a Docker file stored locally
  • The command '/bin/sh returned a non-zero code: 1
  • invalid header field value "oci runtime error while running docker image
  • Use apt-get fails on docker python:2.7.12-wheezy image
  • Trying to send messages between Docker containers using rabbitmq
  • Install PHP 5.5.30 via DockerFile instead of PHP 5.5.9
  • Concourse CI and custom docker-compose
  • Suggestions for carrying out automation using docker
  • Docker swarm load balancing - How to give common name to the service?
  • Is there a way to set ssh options when using docker-machine on Windows?
  • docker swarm service how to specify a delay time in restart policy?
  • One Solution collect form web for “Running Docker pull command in Dockerfile”

    You should not pull from a Dockerfile.

    You simply can start your Dockerfile with:

    FROM docker-oracle-xe-11g
    

    And add in it any Oracle config file which you would need in your own Oracle image.
    The docker-oracle-xe-11g Dockerfile is already based on ubuntu.

    FROM ubuntu:14.04.1
    
    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.