Add workspace base image
Issue - Build workspace base image and use it as base f... (gitlab#524214 - closed)
What does this MR do and why?
Add workspace base image, and use it for other workspace image's base.
Checklist
-
(If applicable) Add patches if required for upgrading Ruby version in https://gitlab.com/gitlab-org/gitlab-build-images/-/tree/master/patches/ruby.
Verification Test
The current base image is pushed here, registry.gitlab.com/gitlab-org/gitlab-build-images/staging:workspaces-base@sha256:45aa444cb1e5641d0f7660bccda83ce4642676479ca9a2a562a99929f094f13a
.
For interactive non-login shell with bash
~/Projects/gitlab-build-images zl/524214 docker run --platform=linux/amd64 -it --rm registry.gitlab.com/gitlab-org/gitlab-build-images/staging:workspaces-base@sha256:45aa444cb1e5641d0f7660bccda83ce4642676479ca9a2a562a99929f094f13a bash
Unable to find image 'registry.gitlab.com/gitlab-org/gitlab-build-images/staging:workspaces-base@sha256:45aa444cb1e5641d0f7660bccda83ce4642676479ca9a2a562a99929f094f13a' locally
registry.gitlab.com/gitlab-org/gitlab-build-images/staging@sha256:45aa444cb1e5641d0f7660bccda83ce4642676479ca9a2a562a99929f094f13a: Pulling from gitlab-org/gitlab-build-images/staging
32f112e3802c: Already exists
b99d826a0fdc: Already exists
f4f6927b4c7a: Pull complete
2f115ca669d6: Pull complete
4f4fb700ef54: Pull complete
c5a7ba66b6b8: Pull complete
c4ef694ac415: Pull complete
e286061b192a: Pull complete
d1ea3d51cc79: Pull complete
Digest: sha256:45aa444cb1e5641d0f7660bccda83ce4642676479ca9a2a562a99929f094f13a
Status: Downloaded newer image for registry.gitlab.com/gitlab-org/gitlab-build-images/staging@sha256:45aa444cb1e5641d0f7660bccda83ce4642676479ca9a2a562a99929f094f13a
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
gitlab-workspaces@c4918360b7d8:~$ which mise
/usr/bin/mise
gitlab-workspaces@c4918360b7d8:~$ mise install node
gpg: Signature made Tue Jul 15 22:13:49 2025 UTC
gpg: using RSA key 890C08DB8579162FEE0DF9DB8BEAB4DFCF555EF4
gpg: Good signature from "RafaelGSS <rafael.nunu@hotmail.com>" [expired]
mise node@24.4.1 ✓ installed gitlab-workspaces@c4918360b7d8:~$ mise use node
mise ~/.config/mise/config.toml tools: node@24.4.1
gitlab-workspaces@c4918360b7d8:~$ node -v
v24.4.1
gitlab-workspaces@c4918360b7d8:~$ echo $PATH
/home/gitlab-workspaces/.local/share/mise/installs/node/24.4.1/bin:/home/gitlab-workspaces/.local/share/mise/shims:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
For interactive login shell with bash
~/Projects/gitlab-build-images zl/524214 docker run --platform=linux/amd64 -it --rm registry.gitlab.com/gitlab-org/gitlab-build-images/staging:workspaces-base@sha256:45aa444cb1e5641d0f7660bccda83ce4642676479ca9a2a562a99929f094f13a bash -l
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
gitlab-workspaces@a060a50c7c8a:~$ which mise
/usr/bin/mise
gitlab-workspaces@a060a50c7c8a:~$ mise install node
gpg: Signature made Tue Jul 15 22:13:49 2025 UTC
gpg: using RSA key 890C08DB8579162FEE0DF9DB8BEAB4DFCF555EF4
gpg: Good signature from "RafaelGSS <rafael.nunu@hotmail.com>" [expired]
mise node@24.4.1 ✓ installed gitlab-workspaces@a060a50c7c8a:~$ mise use node
mise ~/.config/mise/config.toml tools: node@24.4.1
gitlab-workspaces@a060a50c7c8a:~$ node -v
v24.4.1
gitlab-workspaces@a060a50c7c8a:~$ echo $PATH
/home/gitlab-workspaces/.local/share/mise/installs/node/24.4.1/bin:/home/gitlab-workspaces/.local/share/mise/shims:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
For non-interactive login shell with bash
~/Projects/gitlab-build-images zl/524214 docker run --platform=linux/amd64 --rm registry.gitlab.com/gitlab-org/gitlab-build-images/staging:workspaces-base@sha256:45aa444cb1e5641d0f7660bccda83ce4642676479ca9a2a562a99929f094f13a bash -l -c 'which mise && mise install node && mise use node && node -v && echo $PATH'
/usr/bin/mise
mise node@24.4.1 install
mise node@24.4.1 download node-v24.4.1-linux-x64.tar.gz
gpg: Signature made Tue Jul 15 22:13:49 2025 UTC
gpg: using RSA key 890C08DB8579162FEE0DF9DB8BEAB4DFCF555EF4
gpg: Good signature from "RafaelGSS <rafael.nunu@hotmail.com>" [expired]
mise node@24.4.1 checksum node-v24.4.1-linux-x64.tar.gz
mise node@24.4.1 extract node-v24.4.1-linux-x64.tar.gz
mise node@24.4.1 node -v
mise node@24.4.1 v24.4.1
mise node@24.4.1 npm -v
mise node@24.4.1 11.4.2
mise node@24.4.1 ✓ installed
mise ~/.config/mise/config.toml tools: node@24.4.1
v24.4.1
/home/gitlab-workspaces/.local/share/mise/shims:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
For non-interactive non-login shell with bash
~/Projects/gitlab-build-images zl/524214 docker run --platform=linux/amd64 --rm registry.gitlab.com/gitlab-org/gitlab-build-images/staging:workspaces-base@sha256:45aa444cb1e5641d0f7660bccda83ce4642676479ca9a2a562a99929f094f13a bash -c 'which mise && mise install node && mise use node && node -v && echo $PATH'
/usr/bin/mise
mise node@24.4.1 install
mise node@24.4.1 download node-v24.4.1-linux-x64.tar.gz
gpg: Signature made Tue Jul 15 22:13:49 2025 UTC
gpg: using RSA key 890C08DB8579162FEE0DF9DB8BEAB4DFCF555EF4
gpg: Good signature from "RafaelGSS <rafael.nunu@hotmail.com>" [expired]
mise node@24.4.1 checksum node-v24.4.1-linux-x64.tar.gz
mise node@24.4.1 extract node-v24.4.1-linux-x64.tar.gz
mise node@24.4.1 node -v
mise node@24.4.1 v24.4.1
mise node@24.4.1 npm -v
mise node@24.4.1 11.4.2
mise node@24.4.1 ✓ installed
mise ~/.config/mise/config.toml tools: node@24.4.1
v24.4.1
/home/gitlab-workspaces/.local/share/mise/shims:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Then I build latest test web ide workspace image here, registry.gitlab.com/gitlab-org/gitlab-build-images/staging:workspaces-web-ide@sha256:b75adc41b87fac20e71aba32aeb880420cae82281d4836f325e8760af016a906
. We could test out if we go to my draft repo, Test with new worksapce image (gitlab-web-ide!537 - closed)
Click to expand
gitlab-workspaces@workspace-73241-20874665-pc3vmm-6b8b8d47cd-4bq45:/projects/workspace-logs$ cat poststart-stderr.log
Cloning into '/projects/gitlab-web-ide'...
mise node@24.4.1 install
mise node@24.4.1 download node-v24.4.1-linux-x64.tar.gz
gpg: Signature made Tue Jul 15 22:13:49 2025 UTC
gpg: using RSA key 890C08DB8579162FEE0DF9DB8BEAB4DFCF555EF4
gpg: Good signature from "RafaelGSS <rafael.nunu@hotmail.com>" [expired]
mise node@24.4.1 checksum node-v24.4.1-linux-x64.tar.gz
mise node@24.4.1 extract node-v24.4.1-linux-x64.tar.gz
mise node@24.4.1 node -v
mise node@24.4.1 v24.4.1
mise node@24.4.1 npm -v
mise node@24.4.1 11.4.2
mise node@24.4.1 ✓ installed
gitlab-workspaces@workspace-73241-20874665-pc3vmm-6b8b8d47cd-4bq45:/projects/workspace-logs$ mise use node
mise /projects/workspace-logs/mise.toml tools: node@24.4.1
gitlab-workspaces@workspace-73241-20874665-pc3vmm-6b8b8d47cd-4bq45:/projects/workspace-logs$ node -v
v24.4.1
gitlab-workspaces@workspace-73241-20874665-pc3vmm-6b8b8d47cd-4bq45:/projects/workspace-logs$ cat poststart-stdout.log
2025-07-31T01:11:54+00:00: ----------------------------------------
2025-07-31T01:11:54+00:00: Running poststart commands for workspace...
2025-07-31T01:11:54+00:00: ----------------------------------------
2025-07-31T01:11:54+00:00: Running internal blocking poststart commands script...
2025-07-31T01:11:54+00:00: ----------------------------------------
2025-07-31T01:11:54+00:00: Running /workspace-scripts/gl-clone-project-command...
2025-07-31T01:11:54+00:00: ----------------------------------------
2025-07-31T01:11:54+00:00: Cloning project if necessary...
2025-07-31T01:11:54+00:00: Cloning project with "--depth 10" option
2025-07-31T01:11:58+00:00: Project cloning successful
2025-07-31T01:11:58+00:00: Updated '/projects/.gl_project_cloning_successful' file to indicate successful project cloning
2025-07-31T01:11:58+00:00: Successfully finished cloning project.
2025-07-31T01:11:58+00:00: ----------------------------------------
2025-07-31T01:11:58+00:00: Finished running /workspace-scripts/gl-clone-project-command.
2025-07-31T01:11:58+00:00: ----------------------------------------
2025-07-31T01:11:58+00:00: Running /workspace-scripts/gl-clone-unshallow-command...
2025-07-31T01:11:58+00:00: ----------------------------------------
2025-07-31T01:11:58+00:00: Spawning background process to unshallow repo if necessary...
2025-07-31T01:11:58+00:00: Repository is shallow, proceeding with unshallow
2025-07-31T01:11:58+00:00: Starting unshallow in background, with output written to /projects/workspace-logs/clone-unshallow.log
2025-07-31T01:11:58+00:00: Finished spawning background process to unshallow repo.
2025-07-31T01:11:58+00:00: ----------------------------------------
2025-07-31T01:11:58+00:00: Finished running /workspace-scripts/gl-clone-unshallow-command.
2025-07-31T01:11:58+00:00: ----------------------------------------
2025-07-31T01:11:58+00:00: Running /workspace-scripts/gl-start-sshd-command...
2025-07-31T01:11:58+00:00: ----------------------------------------
2025-07-31T01:11:58+00:00: Starting sshd in background if it is found...
2025-07-31T01:11:58+00:00: Starting /usr/sbin/sshd in background on port 60022 with output written to /projects/workspace-logs/start-sshd.log
2025-07-31T01:11:58+00:00: Finished starting sshd in background if it is found.
2025-07-31T01:11:58+00:00: ----------------------------------------
2025-07-31T01:11:58+00:00: Finished running /workspace-scripts/gl-start-sshd-command.
2025-07-31T01:11:58+00:00: ----------------------------------------
2025-07-31T01:11:58+00:00: Running /workspace-scripts/gl-init-tools-command...
2025-07-31T01:11:58+00:00: ----------------------------------------
2025-07-31T01:11:58+00:00: Starting GitLab Fork of VS Code server in background with output written to /projects/workspace-logs/start-vscode.log...
2025-07-31T01:11:58+00:00: VS Code initialization started
2025-07-31T01:11:58+00:00: Finished running /workspace-scripts/gl-init-tools-command.
2025-07-31T01:11:58+00:00: ----------------------------------------
2025-07-31T01:11:58+00:00: Running non-blocking poststart commands script...
2025-07-31T01:11:58+00:00: ----------------------------------------
2025-07-31T01:11:58+00:00: Running /workspace-scripts/gl-sleep-until-container-is-running-command...
2025-07-31T01:11:58+00:00: ----------------------------------------
2025-07-31T01:11:58+00:00: Sleeping until workspace is running...
2025-07-31T01:11:58+00:00: Workspace state is 'Starting' from status file '/.workspace-data/variables/file/gl_workspace_reconciled_actual_state.txt'. Blocking remaining postStart events execution for 5 seconds until state is 'Running'...
2025-07-31T01:12:03+00:00: Workspace state is 'Starting' from status file '/.workspace-data/variables/file/gl_workspace_reconciled_actual_state.txt'. Blocking remaining postStart events execution for 5 seconds until state is 'Running'...
2025-07-31T01:12:09+00:00: Workspace state is 'Starting' from status file '/.workspace-data/variables/file/gl_workspace_reconciled_actual_state.txt'. Blocking remaining postStart events execution for 5 seconds until state is 'Running'...
2025-07-31T01:12:14+00:00: Workspace state is 'Starting' from status file '/.workspace-data/variables/file/gl_workspace_reconciled_actual_state.txt'. Blocking remaining postStart events execution for 5 seconds until state is 'Running'...
2025-07-31T01:12:19+00:00: Workspace state is 'Starting' from status file '/.workspace-data/variables/file/gl_workspace_reconciled_actual_state.txt'. Blocking remaining postStart events execution for 5 seconds until state is 'Running'...
2025-07-31T01:12:24+00:00: Workspace state is 'Starting' from status file '/.workspace-data/variables/file/gl_workspace_reconciled_actual_state.txt'. Blocking remaining postStart events execution for 5 seconds until state is 'Running'...
2025-07-31T01:12:29+00:00: Workspace state is 'Starting' from status file '/.workspace-data/variables/file/gl_workspace_reconciled_actual_state.txt'. Blocking remaining postStart events execution for 5 seconds until state is 'Running'...
2025-07-31T01:12:34+00:00: Workspace state is 'Starting' from status file '/.workspace-data/variables/file/gl_workspace_reconciled_actual_state.txt'. Blocking remaining postStart events execution for 5 seconds until state is 'Running'...
2025-07-31T01:12:39+00:00: Workspace state is 'Starting' from status file '/.workspace-data/variables/file/gl_workspace_reconciled_actual_state.txt'. Blocking remaining postStart events execution for 5 seconds until state is 'Running'...
2025-07-31T01:12:44+00:00: Workspace state is 'Starting' from status file '/.workspace-data/variables/file/gl_workspace_reconciled_actual_state.txt'. Blocking remaining postStart events execution for 5 seconds until state is 'Running'...
2025-07-31T01:12:49+00:00: Workspace state is 'Starting' from status file '/.workspace-data/variables/file/gl_workspace_reconciled_actual_state.txt'. Blocking remaining postStart events execution for 5 seconds until state is 'Running'...
2025-07-31T01:12:54+00:00: Workspace state is 'Starting' from status file '/.workspace-data/variables/file/gl_workspace_reconciled_actual_state.txt'. Blocking remaining postStart events execution for 5 seconds until state is 'Running'...
2025-07-31T01:12:59+00:00: Workspace state is 'Starting' from status file '/.workspace-data/variables/file/gl_workspace_reconciled_actual_state.txt'. Blocking remaining postStart events execution for 5 seconds until state is 'Running'...
2025-07-31T01:13:04+00:00: Workspace state is now 'Running', continuing postStart hook execution.
2025-07-31T01:13:04+00:00: Finished sleeping until workspace is running.
2025-07-31T01:13:04+00:00: ----------------------------------------
2025-07-31T01:13:04+00:00: Finished running /workspace-scripts/gl-sleep-until-container-is-running-command.
2025-07-31T01:13:04+00:00: ----------------------------------------
2025-07-31T01:13:04+00:00: Running /workspace-scripts/install-dependencies...
mise ~/.config/mise/config.toml tools: node@24.4.1
v24.4.1
2025-07-31T01:13:14+00:00: Finished running /workspace-scripts/install-dependencies.
gitlab-workspaces@workspace-73241-20874665-pc3vmm-6b8b8d47cd-4bq45:/projects/workspace-logs$
One thing I am confusing is, we have post-start command mise install node && mise use node && node -v
, and it seems to be running fine. But the output of mise install node
is in log file poststart-stderr.log
, whereas mise use node && node -v
is logged as part of poststart-stdout.log
.
mise ~/.config/mise/config.toml tools: node@24.4.1
v24.4.1