小编edu*_*tua的帖子

运行接受来自主机的流量的Docker容器

我有以下配置:
Dockerfile

FROM centos  
MAINTAINER Eduar Tua <eduartua@gmail.com>  

RUN yum -y update && yum clean all
RUN yum -y install httpd && yum clean all
RUN echo "Apache works" >> /var/www/html/index.html

EXPOSE 80

ADD run-apache.sh /run-apache.sh
RUN chmod -v +x /run-apache.sh

CMD ["/run-apache.sh"]
Run Code Online (Sandbox Code Playgroud)

run-apache.sh脚本:

#!/bin/bash

rm -rf /run/httpd/* /tmp/httpd*

exec /usr/sbin/apachectl -D FOREGROUND
Run Code Online (Sandbox Code Playgroud)

然后我建立图像:

sudo docker build --rm -t platzi/httpd .  
Run Code Online (Sandbox Code Playgroud)

然后

sudo docker run -d -p 80:80 platzi/httpd
Run Code Online (Sandbox Code Playgroud)

之后,当我尝试运行容器接受80端口中主机的连接时,我得到:

67ed31b50133adc7c745308058af3a6586a34ca9ac53299d721449dfa4996657
FATA[0002] Error response from daemon: Cannot start container     67ed31b50133adc7c745308058af3a6586a34ca9ac53299d721449dfa4996657: …
Run Code Online (Sandbox Code Playgroud)

apache centos docker dockerfile

14
推荐指数
3
解决办法
2万
查看次数

Docker:如何创建堆栈,多个图像或一个基本映像?

我是使用Docker的新手,我怀疑在我的堆栈中使用一个图像库,或者我必须根据我的需要定义每个图像.
例如,阅读关于使用docker创建网站的博客,作者建议使用以下Stack: 在此输入图像描述

图片取自http://project-webdev.blogspot.de/2015/05/create-site-based-on-docker-part4-docker-container-architecture.html
现在,看到结构,如果我们有基本图像作为mongoDB,io.JS,nginx等技术的Docker注册表,为什么在这个例子中我们不使用那些使用单个Docker基础映像的图像?

linux deployment backend docker

5
推荐指数
2
解决办法
1845
查看次数

"作业system-cloudinit@-var-tmp-hostname.yml.service失败,因为超出了配置的资源限制"

我开始使用Rancher和Vagrant创建我的本地开发环境.我已经完成的步骤:

  1. 我已经安装了VirtualBox.
  2. 我下载并安装了适用于Linux的Vagrant软件包

    sudo rpm -i vagrant_1.7.2_x86_64.rpm  
    
    Run Code Online (Sandbox Code Playgroud)

Vagrant版本:

vagran --version  
Vagrant 1.7.2  
Run Code Online (Sandbox Code Playgroud)

我从GitHub克隆了Rancher回购:

git clone git@github.com:rancherio/rancher.git  
Run Code Online (Sandbox Code Playgroud)

哪个有Vagrant文​​件.执行后:

sudo vagrant up  
Run Code Online (Sandbox Code Playgroud)

这是我得到错误的步骤,我得到了这个:

==> rancher: Box 'coreos-alpha' could not be found. Attempting to find and install...
rancher: Box Provider: virtualbox
rancher: Box Version: >= 308.0.1
==> rancher: Loading metadata for box 'http://alpha.release.core-os.net/amd64-usr/current/coreos_production_vagrant.json'
rancher: URL: http://alpha.release.core-os.net/amd64-usr/current/coreos_production_vagrant.json
==> rancher: Adding box 'coreos-alpha' (v709.0.0) for provider: virtualbox
rancher: Downloading: http://alpha.release.core-os.net/amd64-usr/709.0.0/coreos_production_vagrant.box
rancher: Calculating and comparing box checksum...
==> rancher: Successfully added box 'coreos-alpha' (v709.0.0) for 'virtualbox'! …
Run Code Online (Sandbox Code Playgroud)

vagrant systemd rancher

5
推荐指数
1
解决办法
2385
查看次数

标签 统计

docker ×2

apache ×1

backend ×1

centos ×1

deployment ×1

dockerfile ×1

linux ×1

rancher ×1

systemd ×1

vagrant ×1