From d6a99294ed0e86cbbd88224a78fafce6331a5cc0 Mon Sep 17 00:00:00 2001 From: James Deathe Date: Tue, 12 Jun 2018 21:20:28 +0100 Subject: [PATCH] ISSUE 34: Adds initial CentOS-7 build. --- CHANGELOG.md | 46 ++----------------- Dockerfile | 12 ++--- README-short.txt | 2 +- README.md | 28 ++++++----- environment.mk | 4 +- .../system/centos-ssh-memcached@.service | 2 +- src/opt/scmi/environment.sh | 4 +- test/shpec/operation_shpec.sh | 1 + 8 files changed, 33 insertions(+), 66 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6616a57..1ab9655 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,49 +1,11 @@ # Change Log -## centos-6 +## centos-7 -Summary of release changes for Version 1. +Summary of release changes for Version 2. -CentOS-6 6.9 x86_64 - Memcached 1.4. +CentOS-7 7.4.1708 x86_64 - Memcached 1.4. -### 1.1.3 - 2018-05-13 - -- Updates source image to [1.8.4 tag](https://github.com/jdeathe/centos-ssh/releases/tag/1.8.4). - -### 1.1.2 - 2018-01-13 - -- Updates source image to [1.8.3 tag](https://github.com/jdeathe/centos-ssh/releases/tag/1.8.3). -- Adds a `.dockerignore` file. - -### 1.1.1 - 2017-09-15 - -- Updates source image to [1.8.2 tag](https://github.com/jdeathe/centos-ssh/releases/tag/1.8.2). - -### 1.1.0 - 2017-08-08 - -- Fixes issue with expect script failure when using `expect -f`. -- Adds `SHPEC_ROOT` variable to Makefile. -- Removes scmi; it's maintained [upstream](https://github.com/jdeathe/centos-ssh/blob/centos-6/src/usr/sbin/scmi). -- Adds use of readonly variables for constants. -- Updates source image to [1.8.1 tag](https://github.com/jdeathe/centos-ssh/releases/tag/1.8.1). -- Adds a `src` directory for the image root files. -- Adds `STARTUP_TIME` variable for the `logs-delayed` Makefile target. -- Adds test case output with improved readability. -- Adds healthcheck. -- Adds [libmemcached](http://libmemcached.org/) to image. -- Adds `MEMCACHED_AUTOSTART_MEMCACHED_WRAPPER` to optionally disable process startup. - -### 1.0.1 - 2017-05-22 - -- Adds source from [jdeathe/centos-ssh:1.7.6](https://github.com/jdeathe/centos-ssh/releases/tag/1.7.6) -- Updates memcached package to `memcached-1.4.4-5.el6`. -- Adds a change log (`CHANGELOG.md`). -- Adds support for semantic version numbered tags. -- Adds minor code style changes to the Makefile for readability. -- Adds support for running `shpec` functional tests with `make test`. -- Adds correct spelling of Memcached in log file path: `/var/log/memcached.log`. -- Replaces deprecated Dockerfile `MAINTAINER` with a `LABEL`. - -### 1.0.0 - 2016-11-23 +### 2.0.0 - Unreleased - Initial release based on Memcached version 1.4. diff --git a/Dockerfile b/Dockerfile index 6fd8904..7c8440d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,16 @@ # ============================================================================= # jdeathe/centos-ssh-memcached # -# CentOS-6, Memcached 1.4. +# CentOS-7, Memcached 1.4. # ============================================================================= -FROM jdeathe/centos-ssh:1.8.4 +FROM jdeathe/centos-ssh:2.3.2 RUN rpm --rebuilddb \ && yum -y install \ --setopt=tsflags=nodocs \ --disableplugin=fastestmirror \ - libmemcached-0.31-1.1.el6 \ - memcached-1.4.4-5.el6 \ + libmemcached-1.0.16-5.el7 \ + memcached-1.4.15-10.el7_3.1 \ && yum versionlock add \ libmemcached* \ memcached* \ @@ -52,7 +52,7 @@ ENV MEMCACHED_AUTOSTART_MEMCACHED_WRAPPER=true \ # ----------------------------------------------------------------------------- # Set image metadata # ----------------------------------------------------------------------------- -ARG RELEASE_VERSION="1.1.3" +ARG RELEASE_VERSION="2.0.0" LABEL \ maintainer="James Deathe " \ install="docker run \ @@ -79,7 +79,7 @@ jdeathe/centos-ssh-memcached:${RELEASE_VERSION} \ org.deathe.license="MIT" \ org.deathe.vendor="jdeathe" \ org.deathe.url="https://github.com/jdeathe/centos-ssh-memcached" \ - org.deathe.description="CentOS-6 6.9 x86_64 - Memcached 1.4." + org.deathe.description="CentOS-7 7.4.1708 x86_64 - Memcached 1.4." HEALTHCHECK \ --interval=0.5s \ diff --git a/README-short.txt b/README-short.txt index b9aaabe..dc24818 100644 --- a/README-short.txt +++ b/README-short.txt @@ -1 +1 @@ -CentOS-6 6.9 x86_64 - Memcached. \ No newline at end of file +CentOS-7 7.4.1708 x86_64 - Memcached. \ No newline at end of file diff --git a/README.md b/README.md index 89cd2fd..503d93d 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,19 @@ centos-ssh-memcached ==================== -Docker Image including CentOS-6 6.9 x86_64 and Memcached 1.4. +Docker Image including: + +- CentOS-6 6.9 x86_64 and Memcached 1.4. +- CentOS-7 7.4.1708 x86_64 and Memcached 1.4. ## Overview & links -The latest CentOS-6 based release can be pulled from the `centos-6` Docker tag. It is recommended to select a specific release tag - the convention is `centos-6-1.1.3` or `1.1.3` for the [1.1.3](https://github.com/jdeathe/centos-ssh-memcached/tree/1.1.3) release tag. +The latest CentOS-6 / CentOS-7 based releases can be pulled from the `centos-6` / `centos-7` Docker tags respectively. For production use it is recommended to select a specific release tag - the convention is `centos-6-1.1.3` OR `1.1.3` for the [1.1.3](https://github.com/jdeathe/centos-ssh-memcached/tree/1.1.3) release tag and `centos-7-2.0.0` OR `2.0.0` for the [2.0.0](https://github.com/jdeathe/centos-ssh/tree/2.0.0) release tag. ### Tags and respective `Dockerfile` links -- `centos-6`, `centos-6-1.1.3`, `1.1.3` [(centos-6/Dockerfile)](https://github.com/jdeathe/centos-ssh-memcached/blob/centos-6/Dockerfile) +- `centos-7`,`centos-7-2.0.0`,`2.0.0` [(centos-7/Dockerfile)](https://github.com/jdeathe/centos-ssh-memcached/blob/centos-7/Dockerfile) +- `centos-6`,`centos-6-1.1.3`,`1.1.3` [(centos-6/Dockerfile)](https://github.com/jdeathe/centos-ssh-memcached/blob/centos-6/Dockerfile) Included in the build are the [SCL](https://www.softwarecollections.org/), [EPEL](http://fedoraproject.org/wiki/EPEL) and [IUS](https://ius.io) repositories. Installed packages include [OpenSSH](http://www.openssh.com/portable.html) secure shell, [vim-minimal](http://www.vim.org/), are installed along with python-setuptools, [supervisor](http://supervisord.org/) and [supervisor-stdout](https://github.com/coderanger/supervisor-stdout). @@ -29,26 +33,26 @@ For cases where access to docker exec is not possible the preferred method is to ## Quick Example -Run up a container named `memcached.pool-1.1.3` from the docker image `jdeathe/centos-ssh-memcached` on port 11211 of your docker host. +Run up a container named `memcached.pool-1.1.1` from the docker image `jdeathe/centos-ssh-memcached` on port 11211 of your docker host. ``` $ docker run -d \ - --name memcached.pool-1.1.3 \ + --name memcached.pool-1.1.1 \ -p 11211:11211/tcp \ - jdeathe/centos-ssh-memcached:centos-6 + jdeathe/centos-ssh-memcached:centos-7 ``` Now you can verify it is initialised and running successfully by inspecting the container's logs. ``` -$ docker logs memcached.pool-1.1.3 +$ docker logs memcached.pool-1.1.1 ``` To verify the Memcached service status: ``` $ docker exec -it \ - memcached.pool-1.1.3 \ + memcached.pool-1.1.1 \ memcached-tool localhost stats ``` @@ -63,15 +67,15 @@ In the following example the memcached service is bound to port 11211 of the doc #### Using environment variables ``` -$ docker stop memcached.pool-1.1.3 && \ - docker rm memcached.pool-1.1.3 +$ docker stop memcached.pool-1.1.1 && \ + docker rm memcached.pool-1.1.1 $ docker run \ --detach \ --tty \ - --name memcached.pool-1.1.3 \ + --name memcached.pool-1.1.1 \ --publish 11211:11211/tcp \ --env "MEMCACHED_CACHESIZE=32" \ - jdeathe/centos-ssh-memcached:centos-6 + jdeathe/centos-ssh-memcached:centos-7 ``` #### Environment Variables diff --git a/environment.mk b/environment.mk index b7f70af..dd1016c 100644 --- a/environment.mk +++ b/environment.mk @@ -6,8 +6,8 @@ DOCKER_IMAGE_NAME := centos-ssh-memcached SHPEC_ROOT := test/shpec # Tag validation patterns -DOCKER_IMAGE_TAG_PATTERN := ^(latest|centos-6|((1|centos-6-1)\.[0-9]+\.[0-9]+))$ -DOCKER_IMAGE_RELEASE_TAG_PATTERN := ^(1|centos-6-1)\.[0-9]+\.[0-9]+$ +DOCKER_IMAGE_TAG_PATTERN := ^(latest|centos-[6-7]|((1|2|centos-(6-1|7-2))\.[0-9]+\.[0-9]+))$ +DOCKER_IMAGE_RELEASE_TAG_PATTERN := ^(1|2|centos-(6-1|7-2))\.[0-9]+\.[0-9]+$ # ----------------------------------------------------------------------------- # Variables diff --git a/src/etc/systemd/system/centos-ssh-memcached@.service b/src/etc/systemd/system/centos-ssh-memcached@.service index aa5f436..06a04b1 100644 --- a/src/etc/systemd/system/centos-ssh-memcached@.service +++ b/src/etc/systemd/system/centos-ssh-memcached@.service @@ -52,7 +52,7 @@ Environment="DOCKER_USER=jdeathe" Environment="DOCKER_CONTAINER_OPTS=" Environment="DOCKER_IMAGE_PACKAGE_PATH=/var/opt/scmi/packages" Environment="DOCKER_IMAGE_NAME=centos-ssh-memcached" -Environment="DOCKER_IMAGE_TAG=1.1.3" +Environment="DOCKER_IMAGE_TAG=2.0.0" Environment="DOCKER_PORT_MAP_TCP_11211=11211" Environment="DOCKER_PORT_MAP_UDP_11211=NULL" Environment="MEMCACHED_AUTOSTART_MEMCACHED_WRAPPER=true" diff --git a/src/opt/scmi/environment.sh b/src/opt/scmi/environment.sh index c55ae8c..88750c2 100644 --- a/src/opt/scmi/environment.sh +++ b/src/opt/scmi/environment.sh @@ -5,8 +5,8 @@ readonly DOCKER_USER=jdeathe readonly DOCKER_IMAGE_NAME=centos-ssh-memcached # Tag validation patterns -readonly DOCKER_IMAGE_TAG_PATTERN='^(latest|centos-6|((1|centos-6-1)\.[0-9]+\.[0-9]+))$' -readonly DOCKER_IMAGE_RELEASE_TAG_PATTERN='^(1|centos-6-1)\.[0-9]+\.[0-9]+$' +readonly DOCKER_IMAGE_TAG_PATTERN='^(latest|centos-[6-7]|((1|2|centos-(6-1|7-2))\.[0-9]+\.[0-9]+))$' +readonly DOCKER_IMAGE_RELEASE_TAG_PATTERN='^(1|2|centos-(6-1|7-2))\.[0-9]+\.[0-9]+$' # ----------------------------------------------------------------------------- # Variables diff --git a/test/shpec/operation_shpec.sh b/test/shpec/operation_shpec.sh index aa68c09..8d761a9 100644 --- a/test/shpec/operation_shpec.sh +++ b/test/shpec/operation_shpec.sh @@ -479,6 +479,7 @@ function test_custom_configuration () bash -c "memcat \ --servers=memcached.pool-1.1.1:11211 \ lorem-ipsum-base64.txt \ + 2> /dev/null \ | awk 'NR > 1 { print line; } \ { line = \$0; } \ END { printf \$0; }'"