Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
devcontainer-features
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
eazydevelop-devcontainer-temp
devcontainer-features
Commits
6d6fb2ba
Unverified
Commit
6d6fb2ba
authored
Jan 31, 2024
by
Samruddhi Khandale
Committed by
GitHub
Jan 31, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[docker-in-docker] : Bug fix - Buildx installation when moby:false (#827)
parent
ccc86033
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
44 additions
and
7 deletions
+44
-7
devcontainer-feature.json
src/docker-in-docker/devcontainer-feature.json
+1
-1
install.sh
src/docker-in-docker/install.sh
+9
-6
docker_build.sh
test/docker-in-docker/docker_build.sh
+2
-0
docker_build_2.sh
test/docker-in-docker/docker_build_2.sh
+2
-0
docker_build_older.sh
test/docker-in-docker/docker_build_older.sh
+2
-0
docker_buildx.sh
test/docker-in-docker/docker_buildx.sh
+19
-0
scenarios.json
test/docker-in-docker/scenarios.json
+9
-0
No files found.
src/docker-in-docker/devcontainer-feature.json
View file @
6d6fb2ba
{
"id"
:
"docker-in-docker"
,
"version"
:
"2.
7.1
"
,
"version"
:
"2.
8.0
"
,
"name"
:
"Docker (Docker-in-Docker)"
,
"documentationURL"
:
"https://github.com/devcontainers/features/tree/main/src/docker-in-docker"
,
"description"
:
"Create child containers *inside* a container, independent from the host's docker instance. Installs Docker extension in the container along with needed CLIs."
,
...
...
src/docker-in-docker/install.sh
View file @
6d6fb2ba
...
...
@@ -317,13 +317,16 @@ if [ "${INSTALL_DOCKER_BUILDX}" = "true" ]; then
buildx_file_name
=
"buildx-v
${
buildx_version
}
.linux-
${
architecture
}
"
cd
/tmp
&&
wget
"https://github.com/docker/buildx/releases/download/v
${
buildx_version
}
/
${
buildx_file_name
}
"
mkdir
-p
${
_REMOTE_USER_HOME
}
/.docker/cli-plugins
mv
${
buildx_file_name
}
${
_REMOTE_USER_HOME
}
/.docker/cli-plugins/docker-buildx
chmod
+x
${
_REMOTE_USER_HOME
}
/.docker/cli-plugins/docker-buildx
docker_home
=
"/usr/libexec/docker"
cli_plugins_dir
=
"
${
docker_home
}
/cli-plugins"
chown
-R
"
${
USERNAME
}
:docker"
"
${
_REMOTE_USER_HOME
}
/.docker"
chmod
-R
g+r+w
"
${
_REMOTE_USER_HOME
}
/.docker"
find
"
${
_REMOTE_USER_HOME
}
/.docker"
-type
d
-print0
| xargs
-n
1
-0
chmod
g+s
mkdir
-p
${
cli_plugins_dir
}
mv
${
buildx_file_name
}
${
cli_plugins_dir
}
/docker-buildx
chmod
+x
${
cli_plugins_dir
}
/docker-buildx
chown
-R
"
${
USERNAME
}
:docker"
"
${
docker_home
}
"
chmod
-R
g+r+w
"
${
docker_home
}
"
find
"
${
docker_home
}
"
-type
d
-print0
| xargs
-n
1
-0
chmod
g+s
fi
tee
/usr/local/share/docker-init.sh
>
/dev/null
\
...
...
test/docker-in-docker/docker_build.sh
View file @
6d6fb2ba
...
...
@@ -11,6 +11,8 @@ check "docker-build" docker build ./
check
"installs docker-compose v1 install"
bash
-c
"type docker-compose"
check
"installs compose-switch"
bash
-c
"[[ -f /usr/local/bin/compose-switch ]]"
check
"docker-buildx"
bash
-c
"docker buildx version"
check
"docker-buildx-path"
bash
-c
"ls -la /usr/libexec/docker/cli-plugins/docker-buildx"
# Report result
reportResults
test/docker-in-docker/docker_build_2.sh
View file @
6d6fb2ba
...
...
@@ -8,6 +8,8 @@ source dev-container-features-test-lib
# Definition specific tests
check
"docker-buildx"
docker buildx version
check
"docker-build"
docker build ./
check
"docker-buildx"
bash
-c
"docker buildx version"
check
"docker-buildx-path"
bash
-c
"ls -la /usr/libexec/docker/cli-plugins/docker-buildx"
# Report result
reportResults
test/docker-in-docker/docker_build_older.sh
View file @
6d6fb2ba
...
...
@@ -8,6 +8,8 @@ source dev-container-features-test-lib
# Definition specific tests
check
"docker-buildx"
docker buildx version
check
"docker-build"
docker build ./
check
"docker-buildx"
bash
-c
"docker buildx version"
check
"docker-buildx-path"
bash
-c
"ls -la /usr/libexec/docker/cli-plugins/docker-buildx"
# Report result
reportResults
test/docker-in-docker/docker_buildx.sh
0 → 100755
View file @
6d6fb2ba
#!/bin/bash
set
-e
# Optional: Import test library
source
dev-container-features-test-lib
# Definition specific tests
check
"docker-buildx"
bash
-c
"docker buildx version"
check
"docker-buildx-path"
bash
-c
"ls -la /usr/libexec/docker/cli-plugins/docker-buildx"
check
"docker-buildx"
docker buildx version
check
"docker-build"
docker build ./
check
"installs docker-compose v1 install"
bash
-c
"type docker-compose"
check
"installs compose-switch"
bash
-c
"[[ -f /usr/local/bin/compose-switch ]]"
# Report result
reportResults
test/docker-in-docker/scenarios.json
View file @
6d6fb2ba
...
...
@@ -68,6 +68,15 @@
},
"remoteUser"
:
"node"
},
"docker_buildx"
:
{
"image"
:
"mcr.microsoft.com/devcontainers/base:bookworm"
,
"features"
:
{
"docker-in-docker"
:
{
"moby"
:
false
,
"installDockerBuildx"
:
true
}
}
},
//
DO
NOT
REMOVE
:
This
scenario
is
used
by
the
docker-in-docker-stress-test
workflow
"docker_with_on_create_command"
:
{
"image"
:
"mcr.microsoft.com/devcontainers/base:debian"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment