I.. dockerfile file:
#Version 1.0 at 2016-04-12#author:http://sunday208.blog.51cto.com/#Base imagesFROM centos#maintainermaintainer http://sunday208.blog.51cto.com/#ADDADD tcl8.6.5-src.tar.gz / usr/local/srcadd redis-3.0.7.tar.gz /usr/local/srcadd centos-base.repo / Usr/local/src#runrun \cp /usr/share/zoneinfo/asia/shanghai /etc/localtimerun rm -rf /etc/yum.repos.d/*.reporun mv /usr/local/src/*.repo /etc/yum.repos.d/run yum clean allrun yum -y install wget net-tools gcc gcc-c++ make#WORKDIRWORKDIR /usr/local/src/tcl8.6.5/unixRUN ./configure --prefix=/usr --without-tzdata --mandir=/usr/share/man $ ([ $ (UNAME -M) = x86_64 ] && echo --enable-64bit) run make & & sed -e "[Email protected]^\ (tcl_src_dir= '). *@\1/usr/include ' @ " -e "/tcl_b/[email Protected]= ' \ (-l\) \?. *[email protected]= ' \1/usr/[email protected] " -i tclConfig.shRUN make test && make install && make install-private-headers && ln -v -sf tclsh8.6 /usr/bin/tclsh && chmod -v 755 /usr/lib/libtcl8.*.so RUN echo -e "/lib \n / Lib64 \n /usr/lib \n /usr/lib64 \n /usr/local/lib \n /usr/local/lib64 ">>/etc/ld.so.confRUN ldconfigWORKDIR /usr/local/src/redis-3.0.7RUN Makerun make installrun cp src/redis-trib.rb /usr/local/bin/ && cp src/redis-server /usr/local/bin/redis-server & & chmod +x /usr/local/bin/redis-serverRUN mkdir /redisdataRUN rm -rf /usr/local/src/{redis-3*,tcl*}add redis.conf /etc/redis.confworkdir /rootrun yum -y remove gcc gcc-c++ makeRUN ln -sf /dev/stdout /tmp/redis.logvolume ["/redisdata"]env redis_version 3.0.7env redis_port 6379env redis_data /redisdataexpose 6379cmd /usr/local/bin/redis-server /etc/redis.conf
Second, download the required software:
[Email protected] redis]# lsbuild.sh centos-base.repo Dockerfile epel-7.repo redis-3.0.7.tar.gz redis.conf tcl8.6.5 -src.tar.gz
Third, the implementation of the use of images:
Docker Build-t Redis:v1/opt/docker/redis
Four, the operation of the container:
650) this.width=650; "src=" http://s1.51cto.com/wyfs02/M00/7E/E5/wKioL1cMj97hNSJdAAT34mDglKU699.jpg "title=" 1.jpg " alt= "Wkiol1cmj97hnsjdaat34mdglku699.jpg"/>
Five, test:
[[email protected] ~]# echo "set Key1 http://sunday208.blog.51cto.com/addblog.php" | Redis-cli-c-P 4034-h 192.168.12.81 ok[[email protected] ~]# echo "Get Key1" | Redis-cli-c-P 4034-h 192.168.12.81 "Http://sunday208.blog.51cto.com/addblog . php "[[email protected] ~]#
Vi. need to address:
Clustered configuration. Test again later.
This article is from the "Urban Cloth" blog, please be sure to keep this source http://sunday208.blog.51cto.com/377871/1762947
Generate Docker image with Dockerfile configuration and implement container deployment (Redis service)