Skip to content

A devcontainer feature that can load and run remote bash scripts which makes the devcontainers more usable

License

Notifications You must be signed in to change notification settings

R4M4NCHICK1/devcontainer-features

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Command and Script Runner, a DevContainer feature that allows you to run any bash scripts without pain:

apt

Install packages easily.

{
    "image": "mcr.microsoft.com/devcontainers/base:ubuntu",
    "features": {
        "ghcr.io/wxw-matt/devcontainer-features/apt:latest": {
			"packages": "vim telnet curl"
        }
    }
}

command runner

It is quite handy to have your packages installed without using other features.

You can have up to 10 commands.

{
    "image": "mcr.microsoft.com/devcontainers/base:ubuntu",
    "features": {
        "ghcr.io/wxw-matt/devcontainer-features/command_runner:latest": {
			"command1": "curl -L 'https://github.com/docker/compose/releases/download/v2.17.3/docker-compose-$(uname -s)-$(uname -m)' -o /usr/local/bin/docker-compose",
			"command2": "chmod +x /usr/local/bin/docker-compose"
        }
    }
}

script runner

{
    "image": "mcr.microsoft.com/devcontainers/base:ubuntu",
    "features": {
        "ghcr.io/wxw-matt/devcontainer-features/script_runner:latest": {
            "script1": "install_vim_plugins#https://gist.githubusercontent.com/wxw-matt/ff35edb5e60c2a404b18724bf63be964/raw",
            "script2": "avoid_password_service_ssh_start#https://gist.github.com/wxw-matt/186afd98891bd2c26adfb5b3045d236c/raw"
        }
    }
}

Explanation

The format of value for script{1-10} is filename#url. For example, if a gist is used, the value should look like:

install_vim_plugins#https://gist.githubusercontent.com/wxw-matt/ff35edb5e60c2a404b18724bf63be964/raw

The install_vim_plugins is the filename in the image/container, and it will be stored in directory /usr/local/scripts_runner/scripts.

The https://gist.githubusercontent.com/wxw-matt/ff35edb5e60c2a404b18724bf63be964/raw is where the file is downloaded from.

The /raw in the url will make GitHub return the content of the gist.

Note:

You can have up to 10 scripts from script1 to script10. The script runner will run each of them in order.

About

A devcontainer feature that can load and run remote bash scripts which makes the devcontainers more usable

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%