标签:Fix add libevent user data months mon rpm rm -rf
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/memcached
vim /data/docker/lnmp-test/dockerfile/memcached/Dockerfile
FROM centos:6
LABEL maintainer="1012405802@qq.com" description="Memcached image"
COPY memcached-1.4.31.tar.gz /root/memcached-1.4.31.tar.gz
RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 && yum -y install libevent-devel gcc && tar -zxvf /root/memcached-1.4.31.tar.gz -C /root/ && cd /root/memcached-1.4.31 && ./configure --prefix=/usr/local/memcached && make -j $(getconf _NPROCESSORS_ONLN) && make install && useradd memcached && ln -s /usr/local/memcached/bin/* /usr/local/bin/ && rm -rf /root/memcached* && yum clean all
USER memcached
EXPOSE 11211
CMD ["memcached"]
cd /data/docker/lnmp-test/dockerfile/memcached/
docker build -t centos6:memcached .
docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
centos6 memcached 0dc1f48c7ac7 11 seconds ago 379MB
centos 6 70b5d81549ec 3 months ago 195MB
docker run -d -p 11211:11211 --name memcached centos6:memcached
firewall-cmd --add-port=11211/tcp --permanent
systemctl restart firewalld
DockerFile部署lnmp+memcached+redis+mongodb开发环境for Memcached(四)
标签:Fix add libevent user data months mon rpm rm -rf
原文地址:https://www.cnblogs.com/93bok/p/9684831.html