In this lesson we will cover how to build your own custom Docker image from scratch. We'll walk through the process of starting a Debian container, installing packages and working through configuration issues, as well as a strategy for building a Dockerfile.

// Installl debian then swich to bash interactive mode
docker run -it debian bash // download tegine
curl http://tengine.taobao.org/download/tengine-2.2.0.tar.gz > /opt/tengine-2.2.0.tar.gz // If curl not found
apt-get update
apt-get install -y curl // cd to the download folder and unzip the file
cd /opt
tar xzf tengine-2.2..tar.gz // then you are able to see tegine-2.2.0 folder
cd tengine-2.2. // Check the document how to install tegine
apt-get install -y gcc
apt-get install -y libpcre3
apt-get install -y libssl-dev
./configure
pat-get install -y make
make
make install // After tegine was install, cd to the sbin folder and run nginx
cd /usr/local/nginx/sbin
/usr/local/nginx/sbin/nginx
ps aux // check whether nginx started or not

Then we exit from the cmd:

exit

mkdir tengine
cd tengine/
vim Dockerfile

Building the docker file:

FROM debian
RUN apt-get update && apt-get install -y \
curl \
gcc \
libpcre3-dev \
libssl-dev \
make RUN curl http://tengine.taobao.org/download/tengine-2.2.0.tar.gz > /opt/tengine-2.2.0.tar.gz WORKDIR /opt RUN tar xzf tengine-2.2..tar.gz WORKDIR /opt/tengine-2.2. RUN ./configure RUN make RUN make install // Then we need to start nginx: https://github.com/nginxinc/docker-nginx/blob/4d1f7f8ec281117d1d79bed4c6bc28b86039ca84/stable/stretch/Dockerfile
// Can find cmd on Docker nginx hub RUN ln -sf /dev/stdout /usr/local/nginx/logs/access.log \
&& ln -sf /dev/stderr /usr/local/nginx/logs/error.log EXPOSE CMD ["/usr/local/nginx/sbin/nginx", "-g", "daemon off;"]

Now we can build our image:

docker build -t zwan/tengine:2.2. .

Check images:

dcoker images

Run image:

docker run -p : zwan/tengine:2.2.

Then check localhost:8000.

[Docker] Build Your Own Custom Docker Image的更多相关文章

  1. 【云计算】docker build如何支持参数化构建?

    docker 1.9.0版本之后,已经支持docker build参数化构建. docker 版本更新记录: github讨论: 参开资料: https://github.com/docker/doc ...

  2. 使用dockerfile构建镜像(docker build)

    Docker buidl .  找出当前文件夹下的Docker build文件名的文件 Docker build -t  centos(镜像名) . 在当前目录下找centos的镜像文件 Docker ...

  3. Docker 使用指南 (六)—— 使用 Docker 部署 Django 容器栈

    版权声明:本文由田飞雨原创文章,转载请注明出处: 文章原文链接:https://www.qcloud.com/community/article/98 来源:腾云阁 https://www.qclou ...

  4. 初试docker以及搭建mysql on docker

    前一阵阅读了google的borg论文,在最后的related works和总结中发现了kubernetes.从论文中了解的kubernetes这个东西很有意思,按照论文所说,它的实现有希望解决an ...

  5. docker: "build" requires 1 argument. See 'docker build --help'.

    http://bbs.csdn.net/topics/391040030 docker build  --tag="ouruser/sinatra:v3" -<Dockerf ...

  6. Docker 踩坑记(failed to build: Get https://registry-1.docker.io/v2/microsoft/dotnet/manifests/2.1-sdk: unauthorized: incorrect username or password)

    今天看了下.net core 示例项目eShopWebOnline. 无奈在使用docker的时候总是提示一下错误信息,大致信息是用户名密码错误.但是,明明桌面右下角Docker帐号处于登录状态. E ...

  7. Docker build Dockerfile 构建镜像 - 二

    Dockerfile 制作镜像 https://hub.docker.com/ 搜索需要镜像: https://hub.docker.com/_/centos/ 官方示例: centos:6 1.这里 ...

  8. Jenkins Docker安装及Docker build step插件部署配置

    生产部署环境:A:192.168.1.2 B:192.168.1.3  两台服务器系统均是Centos 7.3 , Docker版本都1.12.6 Jenkins安装操作步骤: 1.在A服务器上使用命 ...

  9. 25.week4 docker build 也就是创建自己的image 上传image到dockerhub 从dockerhub下载images

    dado可以写你自己的名字 这个命令就会根据目录下的Dockerfile(固定用和这个名字)文件里面的内容 去下载并创建运行命令一步一步地 Setting up libxfixes3:amd64 (: ...

随机推荐

  1. 3.SOAP和WSDL的一些必要知识

    转自:https://www.cnblogs.com/JeffreySun/archive/2009/12/14/1623766.html SOAP和WSDL对Web Service.WCF进行深入了 ...

  2. Chrome 好用的扩展程序

    1. 谷歌访问助手.见名知意. 2. ColorZilla.方便的拾色器和取色器. 3. Restlet Client.方便测试接口. 4. Vue Devtools.Vue项目开发利器. 5. Ta ...

  3. Windows平台上的pip安装

    写在前面 pip 是 Python 的包管理工具,在 Python 开发中必不可少.作为一名python菜鸟,本文在踩坑无数的基础上尽可能详细地解释pip的安装过程.在安装之前需要明确两点: 1.pi ...

  4. [TS] Implement a doubly linked list in TypeScript

    In a doubly linked list each node in the list stores the contents of the node and a pointer or refer ...

  5. 多线程中的&quot;断点&quot;续传《notify()和wait()》

    眼下在做一个项目.关于软件管理与下载的,预计项目提交日期定在6月9号.项目做了有20天了,可是在一个功能上卡住了.在这个项目中有一个功能----APK的下载须要实现. 相信大家都玩过非常多关于下载AP ...

  6. unity3d 改动gui label颜色,定义颜色需除以256

    GUIStyle titleStyle2 = new GUIStyle(); titleStyle2.fontSize = 20; titleStyle2.normal.textColor = new ...

  7. color-在framwork中添加属性变量

    1.今天在修改framwork中的代码的时候,需要把自己在代码中写的一个#ffffff,变成在xml中引用的变量.具体操作方法如下 1)在 frameworks/base/core/res/res/v ...

  8. ORACLE11g R2【RAC+ASM→单实例FS】

    ORACLE11g R2[RAC+ASM→单实例FS] 11g R2 RAC+ASMà单实例FS的DG,建议禁用OMF. 本演示案例所用环境:   primary standby OS Hostnam ...

  9. 方正飞越 A600硬改BIOS激活win7的工具与方法。

    硬件:方正飞越A600-4E57:主板,H61 IPISB-VR:BIOS版本,方正A007SB0(AMI) 软件:Win7专业版 目标:修改BIOS,添加SLIC2.1,硬激活win7 OEM版 具 ...

  10. uiautomator_python使用汇总

    1.判断按钮状态 if d(resourceId="id",enabled=False): #判断当前按钮是否为未激活状态,为True则为激活状态2.获取toast提示语 d.to ...