Expand Docker Container

I'm new to Docker, and I have a question regarding the ability to extend the docker image after pulling it out of the docker repository. I need a specific image of dockers with ubuntu 14.04, java and R. I see that there are images separately with three of them. My question is, where is the Docker file for the newly drawn images, so I can extend them?

+4
source share
5 answers

Dockerfiles are created to create an image, but you cannot perform the reverse operation.

If you want to expand an existing image, you have 2 solutions.

+3

docker pull . Dockerfile. Docker Docker Hub. itzg/ubuntu-openjdk-7 , -.

https://registry.hub.docker.com/u/itzg/ubuntu-openjdk-7/

Docker Dockerfile ( " " Dockefile Docker Hub).

FROM ubuntu:trusty
MAINTAINER itzg
ENV APT_GET_UPDATE 2014-07-19
RUN apt-get update
RUN apt-get install -y openjdk-7-jre-headless
ENV JAVA_HOME /usr/lib/jvm/java-7-openjdk-amd64

Docker edwindj/docker-r.

FROM ubuntu:trusty
MAINTAINER Edwin de Jonge
RUN apt-get update
RUN apt-get install -y r-base

Docker, Docker, .

FROM ubuntu:trusty
RUN apt-get update

# Install java
RUN apt-get install -y openjdk-7-jre-headless
ENV JAVA_HOME /usr/lib/jvm/java-7-openjdk-amd64

# Install R
RUN apt-get install -y r-base

docker build.

$ docker build nacyot/ubuntu-java-r .

java R , nacyot/ubuntu-java-r.

$ docker run -it nacyot/ubuntu-java-r cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.1 LTS"

$ docker run -it nacyot/ubuntu-java-r java -version
java version "1.7.0_55"
OpenJDK Runtime Environment (IcedTea 2.4.7) (7u55-2.4.7-1ubuntu1)
OpenJDK 64-Bit Server VM (build 24.51-b03, mixed mode)

$ docker run -it nacyot/ubuntu-java-r R --version
R version 3.0.2 (2013-09-25) -- "Frisbee Sailing"
Copyright (C) 2013 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under the terms of the
GNU General Public License versions 2 or 3.
For more information about these matters see
http://www.gnu.org/licenses/.

.

, () , , Dockerfiles Docker Hub.

+3

- , . , . , .

  • - sudo docker images - .
  • - . $ sudo docker run "your filename"
  • Docker. ls.
  • , , , # 3.
  • , , , , .

, , 1 , , 2 . , № 2 , , .

" ", : Docker Repository

!

0

. , (AKA commit) ( ). , Dockerfile. , , , , 10 : https://docs.docker.com/userguide/dockerimages/#creating-our-own-images

0

, Dockerfiles , R Java ( , ).

ONBUILD https://docs.docker.com/reference/builder/#onbuild , - , FROM.

java-, , docker FROM java-something . R. docker run ..., ( cmd), - , FROM.

If you need to hack into an existing container, this is also possible. Take a look at what I created to enable oauth in the gitlab container (before they officially did it) @ https://github.com/xeor/dockerfiles/tree/master/gitlab . There I expand the original image and add my own tweeks preset ..

0
source

All Articles