Skip to content

Commit

Permalink
chore: added devcontainer
Browse files Browse the repository at this point in the history
  • Loading branch information
ADRFranklin committed Jan 16, 2024
1 parent e5874b6 commit 01d09bb
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .devcontainer/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.dockerignore
devcontainer.json
docker-compose.yml
Dockerfile
README.md
data
24 changes: 24 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM qmcgaw/basedevcontainer:debian

ENV SHELL /bin/zsh
SHELL ["/bin/zsh", "-c"]

# Install Ubuntu packages
RUN dpkg --add-architecture i386 && apt update && apt install -y curl g++-multilib git ca-certificates wget sudo zip gnupg2

# Setup shells
RUN echo "plugins=(vscode git colorize docker docker-compose)" >> /root/.zshrc-specific

# Install Task
RUN sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin && chmod +x /usr/local/bin/task

# Install Earthly
RUN sudo /bin/sh -c 'wget https://github.com/earthly/earthly/releases/latest/download/earthly-linux-amd64 -O /usr/local/bin/earthly && chmod +x /usr/local/bin/earthly && /usr/local/bin/earthly bootstrap --with-autocomplete'

# Install GoBrew
RUN curl -sLk https://raw.githubusercontent.com/kevincobain2000/gobrew/master/git.io.sh | sh
ENV PATH "/root/.gobrew/current/bin:/root/.gobrew/bin:$PATH"
ENV GOROOT "/root/.gobrew/current/go"

# Install Golang
RUN gobrew use latest
37 changes: 37 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "sampctl-dev",
"dockerComposeFile": [
"docker-compose.yml"
],
"service": "vscode",
"runServices": [
"vscode"
],
"shutdownAction": "stopCompose",
"postCreateCommand": "~/.ssh.sh",
"workspaceFolder": "/workspace",
// "overrideCommand": "",
"customizations": {
"vscode": {
"extensions": [
"IBM.output-colorizer",
"eamodio.gitlens",
"mhutchie.git-graph",
"davidanson.vscode-markdownlint",
"shardulm94.trailing-spaces",
"alefragnani.Bookmarks",
"Gruntfuggly.todo-tree",
"mohsen1.prettify-json",
"quicktype.quicktype",
"spikespaz.vscode-smoothtype",
"stkb.rewrap",
"vscode-icons-team.vscode-icons",
"github.copilot"
],
"settings": {
// General settings
"files.eol": "\n"
}
}
}
}
21 changes: 21 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: "3.7"

services:
vscode:
build: .
volumes:
- ../:/workspace
# Docker socket to access Docker server
- /var/run/docker.sock:/var/run/docker.sock
# SSH directory for Linux, OSX and WSL
# On Linux and OSX, a symlink /mnt/ssh <-> ~/.ssh is
# created in the container. On Windows, files are copied
# from /mnt/ssh to ~/.ssh to fix permissions.
- ~/.ssh:/mnt/ssh
# Shell history persistence
- ~/.zsh_history:/root/.zsh_history
# Git config
- ~/.gitconfig:/root/.gitconfig
environment:
- TZ=Europe\London
entrypoint: ["zsh", "-c", "while sleep 1000; do :; done"]

0 comments on commit 01d09bb

Please sign in to comment.