diff --git a/Makefile b/Makefile index 60e67c9..b4d72b0 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ SHELL_SCRIPTS = $(wildcard _scripts/*.sh) rootfs/bin/boot # The following variables describe the containerized development environment # and other build options DEV_ENV_IMAGE := ${DEV_REGISTRY}/drycc/go-dev -DEV_ENV_WORK_DIR := /go/src/${REPO_PATH} +DEV_ENV_WORK_DIR := /opt/drycc/go/src/${REPO_PATH} DEV_ENV_CMD := docker run --rm -v ${CURDIR}:${DEV_ENV_WORK_DIR} -w ${DEV_ENV_WORK_DIR} ${DEV_ENV_IMAGE} DEV_ENV_CMD_INT := docker run -it --rm -v ${CURDIR}:${DEV_ENV_WORK_DIR} -w ${DEV_ENV_WORK_DIR} ${DEV_ENV_IMAGE} diff --git a/rootfs/Dockerfile b/rootfs/Dockerfile index 723858d..fc0e786 100644 --- a/rootfs/Dockerfile +++ b/rootfs/Dockerfile @@ -1,10 +1,33 @@ -FROM docker.io/library/redis:6-alpine +FROM docker.io/drycc/base:bullseye -COPY . / +RUN adduser --system \ + --shell /bin/bash \ + --disabled-password \ + --home /data \ + --group \ + redis -RUN chown -R redis:redis /etc/redis +COPY bin/boot /bin/boot +COPY etc/redis/redis.conf /etc/redis/redis.conf +ENV REDIS_VERSION="6.2.6" -USER redis +RUN install-stack redis $REDIS_VERSION \ + && rm -rf \ + /usr/share/doc \ + /usr/share/man \ + /usr/share/info \ + /usr/share/locale \ + /var/lib/apt/lists/* \ + /var/log/* \ + /var/cache/debconf/* \ + /etc/systemd \ + /lib/lsb \ + /lib/udev \ + /usr/lib/`echo $(uname -m)`-linux-gnu/gconv/IBM* \ + /usr/lib/`echo $(uname -m)`-linux-gnu/gconv/EBC* \ + && bash -c "mkdir -p /usr/share/man/man{1..8}" \ + && chown -R redis:redis /etc/redis /data +USER redis CMD ["/bin/boot"] EXPOSE 6379 diff --git a/rootfs/bin/boot b/rootfs/bin/boot index 8735d43..4b51afc 100755 --- a/rootfs/bin/boot +++ b/rootfs/bin/boot @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/usr/bin/env bash set -eof pipefail