diff --git a/containers/jekyll/.devcontainer/Dockerfile b/containers/jekyll/.devcontainer/Dockerfile new file mode 100644 index 0000000000..5356db9de0 --- /dev/null +++ b/containers/jekyll/.devcontainer/Dockerfile @@ -0,0 +1,48 @@ +FROM debian:latest + +# Avoid warnings by switching to noninteractive +ENV DEBIAN_FRONTEND=noninteractive + +# This Dockerfile adds a non-root 'vscode' user with sudo access. However, for Linux, +# this user's GID/UID must match your local user UID/GID to avoid permission issues +# with bind mounts. Update USER_UID / USER_GID if yours is not 1000. See +# https://aka.ms/vscode-remote/containers/non-root-user for details. +ARG USERNAME=vscode +ARG USER_UID=1000 +ARG USER_GID=$USER_UID + +# Configure apt and install packages +RUN apt-get update \ + && apt-get -y install --no-install-recommends apt-utils dialog 2>&1 \ + # + # Install vim, git, process tools, lsb-release + && apt-get install -y \ + git \ + # + # Install ruby + && apt-get install -y \ + make \ + build-essential \ + ruby \ + ruby-dev \ + # + # Install jekyll + && gem install \ + bundler \ + jekyll \ + # + # Create a non-root user to use if preferred - see https://aka.ms/vscode-remote/containers/non-root-user. + && groupadd --gid $USER_GID $USERNAME \ + && useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME \ + # [Optional] Add sudo support for the non-root user + && apt-get install -y sudo \ + && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME\ + && chmod 0440 /etc/sudoers.d/$USERNAME \ + # + # Clean up + && apt-get autoremove -y \ + && apt-get clean -y \ + && rm -rf /var/lib/apt/lists/* + +# Switch back to dialog for any ad-hoc use of apt-get +ENV DEBIAN_FRONTEND=dialog \ No newline at end of file diff --git a/containers/jekyll/.devcontainer/devcontainer.json b/containers/jekyll/.devcontainer/devcontainer.json new file mode 100644 index 0000000000..5eb9563c2c --- /dev/null +++ b/containers/jekyll/.devcontainer/devcontainer.json @@ -0,0 +1,25 @@ +{ + "name": "Jekyll", + "dockerFile": "Dockerfile", + + // Use 'settings' to set *default* container specific settings.json values on container create. + // You can edit these settings after create using File > Preferences > Settings > Remote. + "settings": { + "terminal.integrated.shell.linux": "/bin/bash" + }, + + // Use 'appPort' to create a container with published ports. If the port isn't working, be sure + // your server accepts connections from all interfaces (0.0.0.0 or '*'), not just localhost. + // "appPort": ["3000:3000"], + + // Uncomment the next line to run commands after the container is created. + // "postCreateCommand": "cd ${input:projectName} && bundle install", + + // Uncomment the next line to use a non-root user. On Linux, this will prevent + // new files getting created as root, but you may need to update the USER_UID + // and USER_GID in .devcontainer/Dockerfile to match your user if not 1000. + // "runArgs": [ "-u", "vscode" ], + + // Add the IDs of extensions you want installed when the container is created in the array below. + "extensions": [] +} \ No newline at end of file diff --git a/containers/jekyll/.vscode/tasks.json b/containers/jekyll/.vscode/tasks.json new file mode 100644 index 0000000000..e8b62530c7 --- /dev/null +++ b/containers/jekyll/.vscode/tasks.json @@ -0,0 +1,26 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "label": "Serve", + "type": "shell", + "command": "bundle exec jekyll serve --livereload", + "group": { + "kind": "test", + "isDefault": true + }, + "isBackground": true, + }, + { + "label": "Build", + "type": "shell", + "command": "bundle exec jekyll build", + "group": { + "kind": "build", + "isDefault": true + }, + } + ] +} \ No newline at end of file diff --git a/containers/jekyll/README.md b/containers/jekyll/README.md new file mode 100644 index 0000000000..f1a69d4efd --- /dev/null +++ b/containers/jekyll/README.md @@ -0,0 +1,37 @@ +# Jekyll + +## Summary + +*Develop static sites with Jekyll, includes everything you need to get up and running.* + +| Metadata | Value | +|----------|-------| +| *Contributors* | [Carlos Mendible](https://github.com/cmendible) | +| *Definition type* | Dockerfile | +| *Languages, platforms* | Ruby, Jekyll | + +## Using this definition with an existing folder + +Follow these steps: + +1. If this is your first time using a development container, please follow the [getting started steps](https://aka.ms/vscode-remote/containers/getting-started) to set up your machine. + +2. To use VS Code's copy of this definition: + 1. Start VS Code and open your project folder. + 2. Press F1 select and **Remote-Containers: Add Development Container Configuration Files...** from the command palette. + 3. Select the Jekyll definition. + +3. To use latest-and-greatest copy of this definition from the repository: + 1. Clone this repository. + 2. Copy the contents of `containers/jekyll/.devcontainer` to the root of your project folder. + 3. Start VS Code and open your project folder. + +4. After following step 2 or 3, the contents of the `.devcontainer` folder in your project can be adapted to meet your needs. + +5. Finally, press F1 and run **Remote-Containers: Reopen Folder in Container** to start using the definition. + +## License + +Copyright (c) Microsoft Corporation. All rights reserved. + +Licensed under the MIT License. See [LICENSE](https://github.com/Microsoft/vscode-dev-containers/blob/master/LICENSE).