summaryrefslogtreecommitdiff
path: root/devtools
diff options
context:
space:
mode:
authorHervé Beraud <hberaud@redhat.com>2021-07-07 14:53:58 +0200
committerdormando <dormando@rydia.net>2021-07-25 14:40:46 -0700
commit32d90726490044ea421c6df3819f85b2072c00b7 (patch)
tree1cbaff4440ca20fc82e4c76fbceb25b4012764b4 /devtools
parent46bfa8292fa02fa87465908af18f6fefa153fa4d (diff)
downloadmemcached-32d90726490044ea421c6df3819f85b2072c00b7.tar.gz
[docker] Add user and expose the memcached port
These changes aim to improve our memcached devtools images to allow us to reuse them during development stages. These changes create a memcached user for all the images, switch to this user by default once memcached have been configured for building. That allow to run the memcached server directly when the containers are started, else, without the user the run will fail as we try to execute memcached as root user. Also we should notice that the alpine image has been fixed by adding git to the list of the requirements to install. Else the build will fails.
Diffstat (limited to 'devtools')
-rw-r--r--devtools/Dockerfile.alpine5
-rw-r--r--devtools/Dockerfile.arch3
-rw-r--r--devtools/Dockerfile.fedora3
-rw-r--r--devtools/Dockerfile.ubuntu3
4 files changed, 13 insertions, 1 deletions
diff --git a/devtools/Dockerfile.alpine b/devtools/Dockerfile.alpine
index 4d1c955..abbc1ac 100644
--- a/devtools/Dockerfile.alpine
+++ b/devtools/Dockerfile.alpine
@@ -2,8 +2,9 @@ FROM alpine:latest
ARG CONFIGURE_OPTS="--enable-seccomp"
-RUN apk update && apk add --no-cache musl-dev libevent-dev libseccomp-dev linux-headers gcc make automake autoconf perl-test-harness-utils
+RUN apk update && apk add --no-cache musl-dev libevent-dev libseccomp-dev linux-headers gcc make automake autoconf perl-test-harness-utils git
+RUN adduser -S memcached
ADD . /src
WORKDIR /src
@@ -11,4 +12,6 @@ RUN ./autogen.sh
RUN ./configure ${CONFIGURE_OPTS}
RUN make -j
+USER memcached
+
CMD make test
diff --git a/devtools/Dockerfile.arch b/devtools/Dockerfile.arch
index e5e6c55..e70b620 100644
--- a/devtools/Dockerfile.arch
+++ b/devtools/Dockerfile.arch
@@ -5,6 +5,7 @@ ARG CONFIGURE_OPTS="--enable-seccomp"
RUN pacman -Sy && pacman --noconfirm -S gcc automake autoconf libevent libseccomp git make perl
RUN ln -s /usr/bin/core_perl/prove /usr/bin/prove
+RUN useradd -ms /bin/bash memcached
ADD . /src
WORKDIR /src
@@ -16,4 +17,6 @@ RUN autoconf
RUN ./configure ${CONFIGURE_OPTS}
RUN make -j
+USER memcached
+
CMD make test
diff --git a/devtools/Dockerfile.fedora b/devtools/Dockerfile.fedora
index 2cbb25a..bc45341 100644
--- a/devtools/Dockerfile.fedora
+++ b/devtools/Dockerfile.fedora
@@ -4,6 +4,7 @@ ARG CONFIGURE_OPTS="--enable-seccomp"
RUN dnf install -y perl automake autoconf libseccomp-devel libevent-devel gcc make git
+RUN useradd -ms /bin/bash memcached
ADD . /src
WORKDIR /src
@@ -11,4 +12,6 @@ RUN aclocal && autoheader && automake --foreign --add-missing && autoconf
RUN ./configure ${CONFIGURE_OPTS}
RUN make -j
+USER memcached
+
CMD make test
diff --git a/devtools/Dockerfile.ubuntu b/devtools/Dockerfile.ubuntu
index 008c266..1d47d1d 100644
--- a/devtools/Dockerfile.ubuntu
+++ b/devtools/Dockerfile.ubuntu
@@ -4,6 +4,7 @@ ARG CONFIGURE_OPTS="--enable-seccomp"
RUN apt-get update && apt-get install -y build-essential automake1.11 autoconf libevent-dev libseccomp-dev git
+RUN useradd -ms /bin/bash memcached
ADD . /src
WORKDIR /src
@@ -11,4 +12,6 @@ RUN ./autogen.sh
RUN ./configure ${CONFIGURE_OPTS}
RUN make -j
+USER memcached
+
CMD make test