Skip to content

Commit

Permalink
fix: speed up container creation by removing chown -R, and incrementa…
Browse files Browse the repository at this point in the history
…l build by switching to gmake
  • Loading branch information
effective-range committed Dec 7, 2024
1 parent c7f9cd6 commit 806a2d1
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 9 deletions.
5 changes: 3 additions & 2 deletions amd64-container/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ ARG USER_GID=$USER_UID
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME && chown -R $USERNAME:$USERNAME /opt/debs \
&& [ -f /etc/schroot/chroot.d/buildroot ] && chown -R $USERNAME:$USERNAME /var/chroot/buildroot && sed -ri "s/(users=.*)/\1,$USERNAME/g" /etc/schroot/chroot.d/buildroot || true
&& chmod 0440 /etc/sudoers.d/$USERNAME
RUN chown -R $USERNAME:$USERNAME /opt/debs
RUN [ -f /etc/schroot/chroot.d/buildroot ] && sed -ri "s/(users=.*)/\1,$USERNAME/g" /etc/schroot/chroot.d/buildroot || true

# ********************************************************
# * Anything else you want to do like clean up goes here *
Expand Down
2 changes: 1 addition & 1 deletion amd64-container/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
// Configure tool-specific properties.
,
"containerEnv": {
"CMAKE_GENERATOR": "Ninja"
"CMAKE_GENERATOR": "Unix Makefiles"
},
"customizations": {
"vscode": {
Expand Down
5 changes: 3 additions & 2 deletions arm64-container/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ ARG USER_GID=$USER_UID
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME && chown -R $USERNAME:$USERNAME /opt/debs \
&& [ -f /etc/schroot/chroot.d/buildroot ] && chown -R $USERNAME:$USERNAME /var/chroot/buildroot && sed -ri "s/(users=.*)/\1,$USERNAME/g" /etc/schroot/chroot.d/buildroot || true
&& chmod 0440 /etc/sudoers.d/$USERNAME
RUN chown -R $USERNAME:$USERNAME /opt/debs
RUN [ -f /etc/schroot/chroot.d/buildroot ] && sed -ri "s/(users=.*)/\1,$USERNAME/g" /etc/schroot/chroot.d/buildroot || true

# ********************************************************
# * Anything else you want to do like clean up goes here *
Expand Down
2 changes: 1 addition & 1 deletion arm64-container/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
,
"containerEnv": {
"CMAKE_TOOLCHAIN_FILE": "/usr/share/cmake/toolchain.cmake",
"CMAKE_GENERATOR": "Ninja"
"CMAKE_GENERATOR": "Unix Makefiles"
},
"customizations": {
"vscode": {
Expand Down
5 changes: 3 additions & 2 deletions armhf-container/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ ARG USER_GID=$USER_UID
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME && chown -R $USERNAME:$USERNAME /opt/debs \
&& [ -f /etc/schroot/chroot.d/buildroot ] && chown -R $USERNAME:$USERNAME /var/chroot/buildroot && sed -ri "s/(users=.*)/\1,$USERNAME/g" /etc/schroot/chroot.d/buildroot || true
&& chmod 0440 /etc/sudoers.d/$USERNAME
RUN chown -R $USERNAME:$USERNAME /opt/debs
RUN [ -f /etc/schroot/chroot.d/buildroot ] && sed -ri "s/(users=.*)/\1,$USERNAME/g" /etc/schroot/chroot.d/buildroot || true

# ********************************************************
# * Anything else you want to do like clean up goes here *
Expand Down
2 changes: 1 addition & 1 deletion armhf-container/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
,
"containerEnv": {
"CMAKE_TOOLCHAIN_FILE": "/usr/share/cmake/toolchain.cmake",
"CMAKE_GENERATOR": "Ninja"
"CMAKE_GENERATOR": "Unix Makefiles"
},
"customizations": {
"vscode": {
Expand Down

0 comments on commit 806a2d1

Please sign in to comment.