Skip to content

Commit f375052

Browse files
sergiu121dbaluta
authored andcommitted
Change kernel building docker arguments
This was needed because the Ubuntu docker image overwrites the UID argument with a blank string, so we need to rename the variable to something else. Signed-off-by: Sergiu Weisz <sergiu121@gmail.com>
1 parent f0752e4 commit f375052

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

tools/labs/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ docker-docs:
3636
cd docker && UID=$(shell id -u) GID=$(shell id -g) docker-compose run docs-build bash -c "cd /linux/tools/labs && make docs"
3737

3838
docker-kernel:
39-
cd docker && UID=$(shell id -u) GID=$(shell id -g) docker-compose build kernel-build
39+
cd docker && ARG_UID=$(shell id -u) ARG_GID=$(shell id -g) docker-compose build kernel-build
4040
cd docker && docker-compose up -d kernel-build
4141
cd docker && docker-compose exec -u ubuntu kernel-build bash
4242

tools/labs/docker/docker-compose.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@ services:
1313
kernel-build:
1414
privileged: true
1515
tty: true
16+
hostname: "so2"
1617
build:
1718
context: .
1819
dockerfile: ./kernel/Dockerfile
1920
args:
20-
UID: ${UID}
21-
GID: ${GID}
21+
ARG_UID: ${ARG_UID}
22+
ARG_GID: ${ARG_GID}
2223
volumes:
2324
- ../../../:/linux

tools/labs/docker/kernel/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ RUN apt-get -y clean
2828

2929
RUN rm -rf /var/lib/apt/lists/*
3030

31-
ARG UID
32-
ARG GID
31+
ARG ARG_UID
32+
ARG ARG_GID
3333

34-
RUN groupadd -g $GID ubuntu
35-
RUN useradd -u $UID -g $GID -ms /bin/bash ubuntu && adduser ubuntu sudo && echo -n 'ubuntu:ubuntu' | chpasswd
34+
RUN groupadd -g $ARG_GID ubuntu
35+
RUN useradd -u $ARG_UID -g $ARG_GID -ms /bin/bash ubuntu && adduser ubuntu sudo && echo -n 'ubuntu:ubuntu' | chpasswd
3636

3737
# Enable passwordless sudo for users under the "sudo" group
3838
RUN sed -i.bkp -e \

0 commit comments

Comments
 (0)