Skip to content

Commit

Permalink
chore: merge from devcontainers:gh-pages upgrades (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
kosalaperera authored Oct 3, 2021
1 parent 56b6801 commit b60362e
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 39 deletions.
20 changes: 6 additions & 14 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
FROM mcr.microsoft.com/vscode/devcontainers/ruby
# [Choice] Debian OS version (use bullseye on local arm64/Apple Silicon): bullseye, buster
ARG VARIANT=bullseye
FROM mcr.microsoft.com/vscode/devcontainers/jekyll:${VARIANT}

# ENV Variables required by Jekyll
ENV LANG=en_US.UTF-8 \
LANGUAGE=en_US:en \
TZ=Etc/UTC \
LC_ALL=en_US.UTF-8 \
LANG=en_US.UTF-8 \
LANGUAGE=en_US

# Install bundler
RUN gem install bundler jekyll
# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
ARG NODE_VERSION="none"
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi

# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>

# [Optional] Uncomment this line to install additional gems.
# RUN gem install jekyll

# [Optional] Uncomment this line to install global node packages.
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1
2 changes: 2 additions & 0 deletions .devcontainer/_config.devcontainer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ repository: alertbox/bookworm
show_drafts: true
future: true
unpublished: true

github: [metadata]
42 changes: 23 additions & 19 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,40 +1,44 @@
{
"name": "bookworm",

"dockerComposeFile": "docker-compose.yml",
"service": "website",
"workspaceFolder": "/workspace",

// Set *default* container specific settings.json values on container create.
"settings": {
// If you are using an Alpine-based image, change this to /bin/ash
"terminal.integrated.shell.linux": "/bin/zsh"
"terminal.integrated.defaultProfile.linux": "zsh"
},

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-azuretools.vscode-docker",
"ms-edgedevtools.vscode-edge-devtools",

"ritwickdey.liveserver",
"davidanson.vscode-markdownlint",
"ms-vscode.wordcount",

"editorconfig.editorconfig",
"esbenp.prettier-vscode",
"streetsidesoftware.code-spell-checker",
"redhat.fabric8-analytics",
"redhat.vscode-yaml",

"editorconfig.editorconfig",
"esbenp.prettier-vscode",
"streetsidesoftware.code-spell-checker",
"znck.grammarly",
"redhat.fabric8-analytics",
"redhat.vscode-yaml"
],

// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [8004],
"forwardPorts": [
// Jekyll server
8004,
// Live reload server
35729
],

// Uncomment to run commands after the container is created - requires a Gemfile
"postCreateCommand": "zsh .devcontainer/post-create.zsh",

// Uncomment to use the Docker CLI from inside the container. See https://aka.ms/vscode-remote/samples/docker-from-docker.
// "mounts": [ "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" ],
// Uncomment when using a ptrace-based debugger like C++, Go, and Rust
// "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ],
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode",

// Uncomment to indicates whether VS Code should stop the containers when the VS Code window is closed / shut down. Values are "none" and "stopCompose" (default).
"shutdownAction": "stopCompose",
"shutdownAction": "stopCompose"
}
12 changes: 7 additions & 5 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ services:
context: .
dockerfile: Dockerfile
# [Optional] You can use build args to set options. e.g. 'INSTALL_ZSH' below affects the image in the Dockerfile
# args:
# INSTALL_ZSH: "true"
# UPGRADE_PACKAGES: "true"

args:
VARIANT: "dev-bullseye"
INSTALL_ZSH: "true"
UPGRADE_PACKAGES: "true"
# NODE_VERSION: "none"

volumes:
# Forwards the local Docker socket to the container.
# - /var/run/docker.sock:/var/run/docker-host.sock
Expand All @@ -27,4 +29,4 @@ services:
# user: node

# Use "forwardPorts" in **devcontainer.json** to forward an app port locally.
# (Adding the "ports" property to this file will not forward from a Codespace.)
# (Adding the "ports" property to this file will not forward from a Codespace.)
7 changes: 6 additions & 1 deletion .devcontainer/post-create.zsh
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
#!/bin/zsh

## Install the version of Bundler.
if [ -f Gemfile.lock ] && grep "BUNDLED WITH" Gemfile.lock > /dev/null; then
cat Gemfile.lock | tail -n 2 | grep -C2 "BUNDLED WITH" | tail -n 1 | xargs gem install bundler -v
fi

# If there's a Gemfile, then run `bundle install`
# It's assumed that `jekyll` is already installed in the devcontainer.
# It's assumed that the Gemfile will install Jekyll too
if [ -f Gemfile ]; then
bundle install
fi

0 comments on commit b60362e

Please sign in to comment.