Docker | Build Images

Contents

Creating docker images basically means creating and editing Dockerfiles.

These files are configurations files which contains all desired information to build a docker image.

Build images

Dockerfile

Create a Dockerfile

FROM ubuntu:17.10

# Update Ubuntu
ENV DEBIAN_FRONTEND noninteractive

RUN rm -rf /var/cache/apt/archives

RUN apt-get -qq -y                          update           
RUN apt-get -qq -y                          upgrade          
RUN apt-get -qq -y --no-install-recommends  install apt-utils
RUN apt-get -qq -y --no-install-recommends  install ca-certificates curl

# Install Python.
RUN apt-get -qq -y install python python-dev python-pip python-virtualenv

# Clean Up
RUN apt-get autoremove
RUN apt-get clean
RUN rm -rf /var/lib/apt/lists/*

RUN echo "\nexport TERM=xterm" >> /etc/bash.bashrc

# Define default command.
CMD ["bash"]

 Build image

docker build --rm --tag base .

Build images from Baseimages

Linux-based images

Alpine Linux $ docker run gliderlabs/alpine apk add –no-cache nodejs   Link

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.

de German
X