Skip to content

Commit 4c5dff3

Browse files
authored
✨ allow docker without sudo (install docker compose on alpine) (#140)
1 parent bb9bc81 commit 4c5dff3

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@ ARG FROM=webdevops/php-nginx-dev:8.2-alpine
22
ARG DIST_ADDON=-alpine
33
FROM $FROM AS base-alpine
44
# Install additional software Alpine:
5-
RUN apk add --no-cache sudo vim nano git-perl less tree bash-completion mariadb-client iputils sshpass gdb tzdata findmnt jq docker-cli file && \
5+
RUN apk add --no-cache sudo vim nano git-perl less tree bash-completion mariadb-client iputils sshpass gdb tzdata findmnt jq docker-cli docker-compose file && \
6+
addgroup application $(getent group 999 | cut -d: -f1) && \
67
echo "application ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
78

89
FROM $FROM AS base
910
# Install additional software Debian:
1011
RUN apt-get update && \
1112
apt-get install -y sudo vim nano less tree bash-completion mariadb-client iputils-ping sshpass gdb jq && \
1213
usermod -aG sudo application && \
14+
usermod -aG 999 application && \
1315
echo "application ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
1416
curl -fsSL https://get.docker.com/ | sh && \
1517
rm -rf /var/lib/apt/lists/*

start.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
CONTEXT=${CONTEXT:-Development}
99

10-
USER=${APPLICATION_UID:-1000}:${APPLICATION_GID:-1000}
10+
USER=${APPLICATION_UID:-1000}
1111

1212
if [ -z "$SSH_AUTH_SOCK" ]
1313
then

0 commit comments

Comments
 (0)