Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Commit

Permalink
added jekyll developer container
Browse files Browse the repository at this point in the history
  • Loading branch information
cmendible committed Jan 1, 2020
1 parent ec9fd04 commit d37e07c
Show file tree
Hide file tree
Showing 4 changed files with 136 additions and 0 deletions.
48 changes: 48 additions & 0 deletions containers/jekyll/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
25 changes: 25 additions & 0 deletions containers/jekyll/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -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": []
}
26 changes: 26 additions & 0 deletions containers/jekyll/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -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
},
}
]
}
37 changes: 37 additions & 0 deletions containers/jekyll/README.md
Original file line number Diff line number Diff line change
@@ -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 <kbd>F1</kbd> 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 <kbd>F1</kbd> 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).

0 comments on commit d37e07c

Please sign in to comment.