标签:创建 memcached nta rhel desc roo docke lnmp 防火墙
docker pull centos:6
docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
centos 6 70b5d81549ec 2 months ago 195MB
mkdir -p /data/docker/lnmp-test/dockerfile/mongodb
vim /data/docker/lnmp-test/dockerfile/mongodb/Dockerfile
FROM centos:6
LABEL maintainer="1012405802@qq.com" description="Mongodb image"
COPY mongodb-linux-x86_64-rhel62-3.4.10.tgz /root/mongodb-linux-x86_64-rhel62-3.4.10.tgz
RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 && tar -zxvf /root/mongodb-linux-x86_64-rhel62-3.4.10.tgz && mv mongodb-linux-x86_64-rhel62-3.4.10/ /usr/local/mongodb && mkdir -p /mongodb/data && mkdir -p /mongodb/log && mkdir -p /etc/mongodb && ln -s /usr/local/mongodb/bin/* /usr/local/bin/ && echo "dbpath=/mongodb/data" > /etc/mongodb/mongodb.conf && echo "logpath=/mongodb/log/mongodb.log" >> /etc/mongodb/mongodb.conf && echo "port=27017" >> /etc/mongodb/mongodb.conf && echo "logappend=true" >> /etc/mongodb/mongodb.conf && rm -rf /root/mongodb-linux-x86_64-rhel62-3.4.10.tgz
EXPOSE 27017
CMD ["mongod", "-f", "/etc/mongodb/mongodb.conf"]
cd /data/docker/lnmp-test/dockerfile/mongodb/
docker build -t centos6:mongodb .
docker run -d -p 27017:27017 --name mongodb centos6:mongodb
firewall-cmd --add-port=27017/tcp --permanent
systemctl restart firewalld
DockerFile部署lnmp+memcached+redis+mongodb开发环境for MongoDB(六)
标签:创建 memcached nta rhel desc roo docke lnmp 防火墙
原文地址:https://www.cnblogs.com/93bok/p/9684848.html