This repository was archived by the owner on Nov 30, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed
.github/actions/smoke-test Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -69,20 +69,25 @@ runs:
69
69
fi
70
70
71
71
set -e
72
-
73
- # Start container
74
- container_name="vscdc-test-container"
75
- docker run -d --name ${container_name} --rm --init --privileged -v "$(pwd)/containers/${{ inputs.definition }}:/workspace" ${{ inputs.image }} /bin/sh -c 'while sleep 1000; do :; done'
76
72
77
73
# Update UID/GID for user in container - Actions uses different UID/GID than container
78
74
# which causes bind mounts to be read only and cause certain write tests to fail
79
75
# The dev container CLI handles this automatically but we're not using it.
80
76
local_uid=$(id -u)
81
77
local_gid=$(id -g)
82
- echo "(*) Update container user UID/GID..."
83
- docker exec -u root ${container_name} /bin/sh -c "\
84
- groupmod -g ${local_gid} ${{ inputs.user }} \
85
- && usermod -u ${local_uid} -g ${local_gid} ${{ inputs.user }}"
78
+ echo "(*) Updating container user UID/GID..."
79
+ echo -e "FROM ${{ inputs.image }}\n \
80
+ RUN export sudo_cmd="" \
81
+ && if [ "$(id -u)" != "0" ]; then export sudo_cmd=sudo; fi \
82
+ && \${sudo_cmd} groupmod -g ${local_gid} ${{ inputs.user }} \
83
+ && \${sudo_cmd} usermod -u ${local_uid} -g ${local_gid} ${{ inputs.user }}" > uid.Dockerfile
84
+ cat uid.Dockerfile
85
+ docker buildx build --load -t ${{ inputs.image }}-uid -f uid.Dockerfile .
86
+
87
+ # Start container
88
+ echo "(*) Starting container..."
89
+ container_name="vscdc-test-container"
90
+ docker run -d --name ${container_name} --rm --init --privileged -v "$(pwd)/containers/${{ inputs.definition }}:/workspace" ${{ inputs.image }}-uid /bin/sh -c 'while sleep 1000; do :; done'
86
91
87
92
# Fake out existence of extensions, VS Code Server
88
93
echo "(*) Stubbing out extensions and VS Code Server..."
You can’t perform that action at this time.
0 commit comments