Commit 1c80e599 authored by ale's avatar ale

Initial commit

parents
Pipeline #1385 passed with stages
in 47 seconds
image: docker:latest
stages:
- build
- release
services:
- docker:dind
variables:
IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
RELEASE_TAG: $CI_REGISTRY_IMAGE:latest
before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.git.autistici.org
build:
stage: build
script:
- docker build --pull -t $IMAGE_TAG .
- docker push $IMAGE_TAG
release:
stage: release
script:
- docker pull $IMAGE_TAG
- docker tag $IMAGE_TAG $RELEASE_TAG
- docker push $RELEASE_TAG
only:
- master
FROM bitnami/minideb:stretch
COPY build.sh /tmp/build.sh
RUN /tmp/build.sh && rm /tmp/build.sh
ENTRYPOINT ["/bin/sh", "-c", "/usr/bin/memcached -vv -m ${MEM:-64} -p ${PORT:-11211} ${ENABLE_SASL:+-S}"]
Simple Docker role for memcached.
The server can be configured with environment variables:
`MEM` is the max cache size in MB (default 64)
`PORT` is the port to listen on (default 11211)
`ENABLE_SASL` can be set to any value to enable SASL authentication
(a valid */etc/sasldb2* should be mounted into the container for it
to work).
#!/bin/sh
#
# Install script for memcached inside a Docker container.
#
# The default bitnami/minideb image defines an 'install_packages'
# command which is just a convenient helper. Define our own in
# case we are using some other Debian image.
if [ "x$(which install_packages)" = "x" ]; then
install_packages() {
env DEBIAN_FRONTEND=noninteractive apt-get install -qy -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" --no-install-recommends "$@"
}
fi
die() {
echo "ERROR: $*" >&2
exit 1
}
set -x
# Install memcached.
install_packages memcached \
|| die "could not install packages"
# Clean up.
apt-get autoremove -y
apt-get clean
rm -fr /var/lib/apt/lists/*
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment