Add coder/configure example

Adds a directory configure/ containing example files for publishing
images that make use of Coder's configure feature. If an image contains
a script called "configure" in the directory "/coder", it is
automatically run during environment builds. The main use case is
configurations that depend on the $HOME directory that cannot otherwise
be added to an image's Dockerfile.
This commit is contained in:
G r e y 2020-07-09 11:41:20 -05:00
parent 0f96b898c8
commit 38551c25cc
No known key found for this signature in database
GPG Key ID: 1B933BA64CF808BD
2 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,5 @@
FROM ubuntu:latest
RUN apt-get update && apt-get install -y curl
COPY [ "configure", "/coder/configure" ]

11
configure/configure vendored Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
# Configurations that depend on the $HOME directory
## Install NVM, but only if it's not already installed
if [ ! -d $HOME/.nvm ]; then
echo "Installing NVM"
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
else
echo "NVM is already installed"
fi