Skip to content

Commit 4226f91

Browse files
committed
[TASK] Fix permission issue during "ddev start"
1 parent 9a8d0bd commit 4226f91

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

.gitlab-ci.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
21
ddev-initialize:
32
stage: project-template-test
4-
image: ghcr.io/ochorocho/ddev-gitlab-ci:v1.23.1
3+
image: ghcr.io/ochorocho/ddev-gitlab-ci:v1.23
4+
variables:
5+
# Remove "umask 0000" usage, so DDEV has permissions on the cloned repository
6+
# see https://docs.gitlab.com/runner/configuration/feature-flags.html#available-feature-flags
7+
FF_DISABLE_UMASK_FOR_DOCKER_EXECUTOR: 1
58
services:
69
- name: docker:dind
710
when: always
811
script:
9-
- sudo chown -R ddev:ddev /builds/ # Make it work without messing with the permissions
1012
- ddev --version
1113
# ... do things

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ ARG ddev_version
66
ENV DDEV_VERSION=${ddev_version}
77

88
COPY ddev-install.sh ddev-install.sh
9-
RUN ash ddev-install.sh
9+
RUN ash ddev-install.sh && rm ddev-install.sh
1010
USER ddev
1111
RUN mkcert -install

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
This image is most likely to be used within the GitLab Runner.
44
As of now it only tested it on gitlab.com
55

6+
**GitLab CI example**: [.gitlab-ci.yml](.gitlab-ci.yml)
7+
68
# Workflow - Image build
79

810
Build the image

ddev-install.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ adduser -D ddev -g "ddev" -s /bin/bash -D ddev -h /home/ddev
55
echo "ddev ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/ddev && chmod 0440 /etc/sudoers.d/ddev
66
unamearch=$(uname -m)
77

8+
RED='\033[31m'
9+
RESET='\033[0m'
10+
811
# Get binary to be downloaded
912
case ${unamearch} in
1013
x86_64) ARCH="amd64";
@@ -29,4 +32,4 @@ rm -Rf ddev "ddev_linux-${ARCH}.${DDEV_VERSION}.tar.gz"
2932
# Ensure required folders exist
3033
mkdir -p /home/ddev/.ddev/commands/host
3134
mkdir /builds
32-
chown -R ddev:ddev /home/ddev/.ddev/ /builds
35+
chown -R ddev:ddev /home/ddev/.ddev/

0 commit comments

Comments
 (0)