pense-bête de bruno sanchiz

Accueil > Virtualisation > Virtualisation : dockerfile

Virtualisation : dockerfile

Publié le 10 février 2019, dernière mise-à-jour le 22 juin 2023, 2 visites, 24358 visites totales.


python 3

installation d’un php5

Téléchargement de php/5.6/stretch/apache/Dockerfile via le bouton raw de https://github.com/docker-library/php/blob/783878384a8f3953ed571e5a34ba0fe546726c85/5.6/stretch/apache/Dockerfile

on obtient le NAME par docker ps , puis
IP=$(docker inspect awesome_haslett |grep '"IPAddress"' |head -n 1  |sed 's/.*"\([0-9]*\.[0-9]*\.[0-9]*\.[0-9]*\)".*/\1/')


essai de php7 sur lmde2 : créer un Dockerfile avec

FROM debian:stretch
MAINTAINER dindoun
RUN echo ’deb http://deb.debian.org/debian stretch contrib non-free’ >> /etc/apt/sources.list
RUN echo ’deb http://deb.debian.org/debian stretch-updates contrib non-free’ >> /etc/apt/sources.list
RUN echo ’deb http://security.debian.org stretch/updates contrib non-free’ >> /etc/apt/sources.list
RUN apt-get update
RUN apt-get install -y apt-utils
RUN apt-get install -y php7.0 apache2 phpmyadmin

essai de python2.7 : https://docs.docker.com/get-started/part2

docker build . --tag="python2.7:5"
docker build -t friendlyhello5 .
docker run -p 4000:80 friendlyhello5

Dockerfile :

FROM python:2.7-slim
WORKDIR /app
ADD . /app
CMD ["python", "app.py"]

app.py :

for i in range(10):
	print(i)

docker images :

REPOSITORYTAGIMAGE IDCREATEDSIZE
friendlyhello5lateste6d72d5180fc23 minutes ago182 MB
[bruno sanchiz]