用Dockerfile自建Dolibarr之docker镜像images
in dolibarr with 0 comment

用Dockerfile自建Dolibarr之docker镜像images

in dolibarr with 0 comment

用的是https://github.com/Dolibarr/dolibarr/blob/develop/Dockerfile这份Dockerfile,如下:
1、先创建文件夹:
sudo mkdir dolibarr
cd dolibarr
进到dolibarr文件夹后,
2、再创建Dockefile:
sudo vim Dockerfile
内容如下:




FROM php:5.6-apache

RUN apt-get update && apt-get install -y libpng12-dev libjpeg-dev \

&& rm -rf /var/lib/apt/lists/* \
&& docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \
&& docker-php-ext-install gd

RUN docker-php-ext-install mysqli

COPY htdocs/ /var/www/html/

RUN chown -hR www-data:www-data /var/www/html

EXPOSE 80



然后,重点来了,用docker build来创建images镜像:
3、命令如下 :
sudo docker build dolibarr .
请注意末尾有一个英文状态下的句号.句点,这个“.“小句点我之前一直没加上,所以build不下去,一直报错就是这里。


root@server:/home/liangjia/docker/dolibarr# ls
Dockerfile
root@server:/home/liangjia/docker/dolibarr# docker build -t dolibarr
docker: "build" requires 1 argument.
See 'docker build --help'.

Usage: docker build [OPTIONS] PATH | URL | -

Build an image from a Dockerfile
root@server:/home/liangjia/docker/dolibarr# docker build -t dolibarr .
Sending build context to Docker daemon 2.048 kB
Step 1 : FROM php:5.6-apache
Pulling repository docker.io/library/php
88536ecbcd56: Pulling dependent layers
cb6fb082434e: Downloading 13.4 MB


Responses