针对开源网络打印机软件CUPS的容器化实践
创建一个目录,并在目录内建立一个文件名为Dockerfile的文件和文件名为cupsd.conf的配置文件
Dockerfile
#使用原始镜像
FROM centos:6
#作者
MAINTAINER shark1985
#使用阿里云yum源
RUN curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo && yum makecache
#安装cups及组件
RUN yum -y install cups cups-libs
#备份原始配置文件
RUN mv /etc/cups/cupsd.conf /etc/cups/cupsd.conf.bak
#将cupsd.conf文件复制到配置目录
COPY cupsd.conf /etc/cups/
#开放631端口
EXPOSE 631
#运行cups服务
CMD ["cupsd"]
cupsd.conf
在配置文件上做如下修改
- 其中修改了"Listen *:631",允许任何地址访问
- 如下增加"Allow all"配置
Restrict access to the server…
Order allow,deny
Allow all
Restrict access to the ad