0

I have a devcontainer configuration like this:

{
    "name": "App",
    "dockerComposeFile": "docker-compose.yml",
    "service": "app",
    "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
    "features": {
        "ghcr.io/rocker-org/devcontainer-features/apt-packages:1": {
            "packages": "libvips, vim, libpq-dev, postgresql-client"
        },
        "ghcr.io/devcontainers/features/git:1": {
            "version": "latest"
        },
        "ghcr.io/devcontainers/features/ruby:1": {
            "version": "3.2.1",
            "username": "vscode"
        },
        "ghcr.io/devcontainers/features/node:1": {
            "version": 19
        },
        "ghcr.io/devcontainers/features/common-utils:2": {
            "username": "vscode",
            "userUid": 1000,
            "userGid": 1000,
            "installZsh": true,
            "installOhMyZsh": true,
            "configureZshAsDefaultShell": true,
            "upgradePackages": true
        },
        "ghcr.io/devcontainers-contrib/features/zsh-plugins:0": {
            "username": "vscode",
            "plugins": "bundler rails ruby yarn zsh-autosuggestions zsh-syntax-highlighting",
            "omzPlugins": "https://github.com/zsh-users/zsh-autosuggestions https://github.com/zsh-users/zsh-syntax-highlighting"
        },
        "ghcr.io/devcontainers/features/sshd:1": {},
        "ghcr.io/dhoeric/features/flyctl:1": {},
        "ghcr.io/christopherMacGown/devcontainer-features/mcfly:1": {}
    },
    "forwardPorts": [2222],

    "postCreateCommand": ".devcontainer/boot.sh"

and the boot.sh file is where I do some final setups, including (trying to) update Oh My Zsh:

#!/bin/zsh

echo "Update OMZ..."
omz update

echo "Setting SSH password for vscode user..."
sudo usermod --password $(echo vscode | openssl passwd -1 -stdin) vscode

echo "Do no install gem docs"
echo "gem: --no-ri --no-rdoc" >> ~/.gemrc
echo "Done..."

...

I can't really understand why but I the command omz update does not work during this phase:

.devcontainer/boot.sh
Update OMZ...
.devcontainer/boot.sh:4: command not found: omz

I previously added whoami before omz update and I'm indeed under the vscode user so I should be able to run omz at this point because it was installed already.

Luiz E.
  • 6,769
  • 10
  • 58
  • 98

0 Answers0