diff --git a/CHANGELOG.md b/CHANGELOG.md index 395d7f1..ebef5b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,9 +6,15 @@ Summary of release changes for Version 2. CentOS-7 7.5.1804 x86_64 - Memcached 1.4. +### 2.1.1 - 2018-11-16 + +- Fixes typo in test; using `--format` instead of `--filter`. +- Adds required `--sysctl` settings to docker run templates. +- Updates source image to [2.4.1](https://github.com/jdeathe/centos-ssh/releases/tag/2.4.1). + ### 2.1.0 - 2018-08-16 -- Updates source image to [1.9.0](https://github.com/jdeathe/centos-ssh/releases/tag/1.9.0). +- Updates source image to [2.4.0](https://github.com/jdeathe/centos-ssh/releases/tag/2.4.0). ### 2.0.0 - 2018-05-12 diff --git a/Dockerfile b/Dockerfile index c71affd..b49b4ba 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ # # CentOS-7, Memcached 1.4. # ============================================================================= -FROM jdeathe/centos-ssh:2.4.0 +FROM jdeathe/centos-ssh:2.4.1 RUN rpm --rebuilddb \ && yum -y install \ @@ -52,7 +52,7 @@ ENV MEMCACHED_AUTOSTART_MEMCACHED_WRAPPER=true \ # ----------------------------------------------------------------------------- # Set image metadata # ----------------------------------------------------------------------------- -ARG RELEASE_VERSION="2.1.0" +ARG RELEASE_VERSION="2.1.1" LABEL \ maintainer="James Deathe " \ install="docker run \ diff --git a/README.md b/README.md index 9048ae3..e655810 100644 --- a/README.md +++ b/README.md @@ -8,12 +8,12 @@ Docker Image including: ## Overview & links -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.2.0` OR `1.2.0` for the [1.2.0](https://github.com/jdeathe/centos-ssh-memcached/tree/1.2.0) release tag and `centos-7-2.1.0` OR `2.1.0` for the [2.1.0](https://github.com/jdeathe/centos-ssh/tree/2.1.0) 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.2.1` OR `1.2.1` for the [1.2.1](https://github.com/jdeathe/centos-ssh-memcached/tree/1.2.1) release tag and `centos-7-2.2.1` OR `2.2.1` for the [2.2.1](https://github.com/jdeathe/centos-ssh/tree/2.2.1) release tag. ### Tags and respective `Dockerfile` links -- `centos-7`,`centos-7-2.1.0`,`2.1.0` [(centos-7/Dockerfile)](https://github.com/jdeathe/centos-ssh-memcached/blob/centos-7/Dockerfile) -- `centos-6`,`centos-6-1.2.0`,`1.2.0` [(centos-6/Dockerfile)](https://github.com/jdeathe/centos-ssh-memcached/blob/centos-6/Dockerfile) +- `centos-7`,`centos-7-2.2.1`,`2.2.1` [(centos-7/Dockerfile)](https://github.com/jdeathe/centos-ssh-memcached/blob/centos-7/Dockerfile) +- `centos-6`,`centos-6-1.2.1`,`1.2.1` [(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). @@ -39,7 +39,8 @@ Run up a container named `memcached.pool-1.1.1` from the docker image `jdeathe/c $ docker run -d \ --name memcached.pool-1.1.1 \ -p 11211:11211/tcp \ - jdeathe/centos-ssh-memcached:2.1.0 + --sysctl "net.core.somaxconn=1024" \ + jdeathe/centos-ssh-memcached:2.2.1 ``` Now you can verify it is initialised and running successfully by inspecting the container's logs. @@ -74,8 +75,11 @@ $ docker run \ --tty \ --name memcached.pool-1.1.1 \ --publish 11211:11211/tcp \ + --sysctl "net.core.somaxconn=1024" \ + --sysctl "net.ipv4.ip_local_port_range=1024 65535" \ + --sysctl "net.ipv4.route.flush=1" \ --env "MEMCACHED_CACHESIZE=32" \ - jdeathe/centos-ssh-memcached:2.1.0 + jdeathe/centos-ssh-memcached:2.2.1 ``` #### Environment Variables diff --git a/default.mk b/default.mk index 3264011..3f49c73 100644 --- a/default.mk +++ b/default.mk @@ -3,6 +3,9 @@ define DOCKER_CONTAINER_PARAMETERS --name $(DOCKER_NAME) \ --restart $(DOCKER_RESTART_POLICY) \ +--sysctl "net.core.somaxconn=$(SYSCTL_NET_CORE_SOMAXCONN)" \ +--sysctl "net.ipv4.ip_local_port_range=$(SYSCTL_NET_IPV4_IP_LOCAL_PORT_RANGE)" \ +--sysctl "net.ipv4.route.flush=$(SYSCTL_NET_IPV4_ROUTE_FLUSH)" \ --env "MEMCACHED_AUTOSTART_MEMCACHED_WRAPPER=$(MEMCACHED_AUTOSTART_MEMCACHED_WRAPPER)" \ --env "MEMCACHED_CACHESIZE=$(MEMCACHED_CACHESIZE)" \ --env "MEMCACHED_MAXCONN=$(MEMCACHED_MAXCONN)" \ diff --git a/environment.mk b/environment.mk index dd1016c..b9cc487 100644 --- a/environment.mk +++ b/environment.mk @@ -13,6 +13,11 @@ DOCKER_IMAGE_RELEASE_TAG_PATTERN := ^(1|2|centos-(6-1|7-2))\.[0-9]+\.[0-9]+$ # Variables # ----------------------------------------------------------------------------- +# Docker --sysctl settings +SYSCTL_NET_CORE_SOMAXCONN ?= 1024 +SYSCTL_NET_IPV4_IP_LOCAL_PORT_RANGE ?= 1024 65535 +SYSCTL_NET_IPV4_ROUTE_FLUSH ?= 1 + # Docker image/container settings DOCKER_CONTAINER_OPTS ?= DOCKER_IMAGE_TAG ?= latest diff --git a/src/etc/systemd/system/centos-ssh-memcached@.service b/src/etc/systemd/system/centos-ssh-memcached@.service index 143b57d..9def04d 100644 --- a/src/etc/systemd/system/centos-ssh-memcached@.service +++ b/src/etc/systemd/system/centos-ssh-memcached@.service @@ -52,13 +52,16 @@ 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=2.1.0" +Environment="DOCKER_IMAGE_TAG=2.1.1" Environment="DOCKER_PORT_MAP_TCP_11211=11211" Environment="DOCKER_PORT_MAP_UDP_11211=NULL" Environment="MEMCACHED_AUTOSTART_MEMCACHED_WRAPPER=true" Environment="MEMCACHED_CACHESIZE=64" Environment="MEMCACHED_MAXCONN=1024" Environment="MEMCACHED_OPTIONS=-U 0" +Environment="SYSCTL_NET_CORE_SOMAXCONN=1024" +Environment="SYSCTL_NET_IPV4_IP_LOCAL_PORT_RANGE=1024 65535" +Environment="SYSCTL_NET_IPV4_ROUTE_FLUSH=1" # Initialisation: Load image from local storage if available, otherwise pull. ExecStartPre=/bin/bash -c \ @@ -88,6 +91,9 @@ ExecStartPre=-/bin/bash -c \ ExecStart=/bin/bash -c \ "exec /usr/bin/docker run \ --name %p.%i \ + --sysctl \"net.core.somaxconn=${SYSCTL_NET_CORE_SOMAXCONN}\" \ + --sysctl \"net.ipv4.ip_local_port_range=${SYSCTL_NET_IPV4_IP_LOCAL_PORT_RANGE}\" \ + --sysctl \"net.ipv4.route.flush=${SYSCTL_NET_IPV4_ROUTE_FLUSH}\" \ --env \"MEMCACHED_AUTOSTART_MEMCACHED_WRAPPER=${MEMCACHED_AUTOSTART_MEMCACHED_WRAPPER}\" \ --env \"MEMCACHED_CACHESIZE=${MEMCACHED_CACHESIZE}\" \ --env \"MEMCACHED_MAXCONN=${MEMCACHED_MAXCONN}\" \ diff --git a/src/opt/scmi/default.sh b/src/opt/scmi/default.sh index 0643f9c..2ed304c 100644 --- a/src/opt/scmi/default.sh +++ b/src/opt/scmi/default.sh @@ -40,6 +40,9 @@ fi # Common parameters of create and run targets DOCKER_CONTAINER_PARAMETERS="--name ${DOCKER_NAME} \ --restart ${DOCKER_RESTART_POLICY} \ +--sysctl \"net.core.somaxconn=${SYSCTL_NET_CORE_SOMAXCONN}\" \ +--sysctl \"net.ipv4.ip_local_port_range=${SYSCTL_NET_IPV4_IP_LOCAL_PORT_RANGE}\" \ +--sysctl \"net.ipv4.route.flush=${SYSCTL_NET_IPV4_ROUTE_FLUSH}\" \ --env \"MEMCACHED_AUTOSTART_MEMCACHED_WRAPPER=${MEMCACHED_AUTOSTART_MEMCACHED_WRAPPER}\" \ --env \"MEMCACHED_CACHESIZE=${MEMCACHED_CACHESIZE}\" \ --env \"MEMCACHED_MAXCONN=${MEMCACHED_MAXCONN}\" \ diff --git a/src/opt/scmi/environment.sh b/src/opt/scmi/environment.sh index 88750c2..bad6865 100644 --- a/src/opt/scmi/environment.sh +++ b/src/opt/scmi/environment.sh @@ -30,6 +30,11 @@ DIST_PATH="${DIST_PATH:-./dist}" # Number of seconds expected to complete container startup including bootstrap. STARTUP_TIME="${STARTUP_TIME:-1}" +# Docker --sysctl settings +SYSCTL_NET_CORE_SOMAXCONN="${SYSCTL_NET_CORE_SOMAXCONN:-1024}" +SYSCTL_NET_IPV4_IP_LOCAL_PORT_RANGE="${SYSCTL_NET_IPV4_IP_LOCAL_PORT_RANGE:-1024 65535}" +SYSCTL_NET_IPV4_ROUTE_FLUSH="${SYSCTL_NET_IPV4_ROUTE_FLUSH:-1}" + # ETCD register service settings REGISTER_ETCD_PARAMETERS="${REGISTER_ETCD_PARAMETERS:-}" REGISTER_TTL="${REGISTER_TTL:-60}" diff --git a/src/opt/scmi/service-unit.sh b/src/opt/scmi/service-unit.sh index 7eb5a95..0cd6062 100644 --- a/src/opt/scmi/service-unit.sh +++ b/src/opt/scmi/service-unit.sh @@ -11,6 +11,9 @@ readonly SERVICE_UNIT_ENVIRONMENT_KEYS=" MEMCACHED_CACHESIZE MEMCACHED_MAXCONN MEMCACHED_OPTIONS + SYSCTL_NET_CORE_SOMAXCONN + SYSCTL_NET_IPV4_IP_LOCAL_PORT_RANGE + SYSCTL_NET_IPV4_ROUTE_FLUSH " readonly SERVICE_UNIT_REGISTER_ENVIRONMENT_KEYS=" REGISTER_ETCD_PARAMETERS diff --git a/test/shpec/operation_shpec.sh b/test/shpec/operation_shpec.sh index 8d761a9..4dd91fe 100644 --- a/test/shpec/operation_shpec.sh +++ b/test/shpec/operation_shpec.sh @@ -517,8 +517,8 @@ function test_custom_configuration () it "Can disable memcached-wrapper." docker ps \ - --format "name=memcached.pool-1.1.1" \ - --format "health=healthy" \ + --filter "name=memcached.pool-1.1.1" \ + --filter "health=healthy" \ &> /dev/null \ && docker top \ memcached.pool-1.1.1 \