Commit c653badc authored by Helfer's avatar Helfer
Browse files

Fixed permission error. No sudo for Docker group.

parent 2454cdf2
vol/
docker-compose.yaml
variables.local
apache/dockerfile
rdmo/dockerfile
\ No newline at end of file
FROM httpd:latest
ARG UID=<UID>
ENV HTTPD_CONF="/usr/local/apache2/conf/httpd.conf"
RUN apt update -y && apt install -y \
......@@ -18,7 +20,7 @@ RUN echo "LoadModule wsgi_module /usr/lib/apache2/modules/mod_wsgi.so" >> ${HTTP
RUN mkdir -p /usr/local/apache2/conf.d
COPY vhosts.conf /usr/local/apache2/conf.d/vhosts.conf
RUN useradd -ms /bin/bash rdmo
RUN useradd -m -u $UID -s /bin/bash rdmo
RUN mkdir -p /var/www/html
RUN mkdir -p /var/run/apache2
......
......@@ -4,6 +4,14 @@ DC_TEMP="docker-compose.yaml"
VARS_ENV=$(shell if [ -f variables.local ]; then echo variables.local; else echo variables.env; fi)
GLOBAL_PREFIX=$(shell cat ${CURDIR}/${VARS_ENV} | grep -Po "(?<=GLOBAL_PREFIX=).*")
FINALLY_EXPOSED_PORT=$(shell cat ${CURDIR}/${VARS_ENV} | grep -Po "(?<=FINALLY_EXPOSED_PORT=)[0-9]+")
DOCKER_IN_GROUPS=$(shell groups | grep "docker")
MYID=$(shell id -u)
ifeq ($(strip $(DOCKER_IN_GROUPS)),)
SUDO_CMD=sudo
else
SUDO_CMD=
endif
all: preparations run_build tail_logs
preps: preparations
......@@ -23,13 +31,21 @@ preparations:
| sed 's|<FINALLY_EXPOSED_PORT>|${FINALLY_EXPOSED_PORT}|g' \
| sed 's|<VARIABLES_FILE>|${VARS_ENV}|g' \
> ${DC_TEMP}
cat rdmo/dockerfile_master \
| sed 's|<UID>|$(MYID)|g' \
> rdmo/dockerfile
cat apache/dockerfile_master \
| sed 's|<UID>|$(MYID)|g' \
> apache/dockerfile
run_build:
sudo docker-compose up --build -d
$(SUDO_CMD)docker-compose up --build -d
run_remove:
sudo docker-compose down --rmi all
sudo docker-compose rm --force
$(SUDO_CMD)docker-compose down --rmi all
$(SUDO_CMD)docker-compose rm --force
tail_logs:
sudo docker-compose logs -f
$(SUDO_CMD)docker-compose logs -f
\ No newline at end of file
FROM debian:latest
ARG UID=<UID>
ENV PATH=/opt:${PATH}
RUN apt update -y && apt install -y \
......@@ -28,7 +30,7 @@ RUN apt install -y \
COPY ./rootfs /
RUN useradd -ms /bin/bash rdmo
RUN useradd -m -u $UID -s /bin/bash rdmo
USER rdmo
CMD ["/drun.sh"]
Supports Markdown
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