Skip to content

Commit 4c746a0

Browse files
committed
feat: include docker in docker
1 parent a79ee92 commit 4c746a0

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,17 @@ RUN apt update && apt install -y locales build-essential git curl sudo make jq u
1010
libxmlsec1-dev libffi-dev liblzma-dev apt-transport-https ca-certificates software-properties-common \
1111
cmake ninja-build libgtk-3-dev
1212

13+
# add docker official gpg key
14+
RUN install -m 0755 -d /etc/apt/keyrings
15+
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
16+
RUN chmod a+r /etc/apt/keyrings/docker.asc
17+
18+
# add the repository to apt sources:
19+
RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
20+
21+
# install docker
22+
RUN apt update && apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
23+
1324
# gilab-runner package
1425
RUN curl -L "https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh" | bash
1526
RUN apt install -y gitlab-runner
@@ -31,6 +42,10 @@ RUN echo "runner ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
3142
WORKDIR /home/runner
3243
USER runner
3344

45+
# set group
46+
RUN sudo usermod -aG docker runner
47+
RUN newgrp docker
48+
3449
# set initial git config
3550
RUN git config --global --add safe.directory /home/gitlab-runner/builds*
3651

0 commit comments

Comments
 (0)