diff --git a/.devcontainer/.dockerignore b/.devcontainer/.dockerignore new file mode 100644 index 00000000..f16cfe7b --- /dev/null +++ b/.devcontainer/.dockerignore @@ -0,0 +1,6 @@ +.dockerignore +devcontainer.json +docker-compose.yml +Dockerfile +README.md +data diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 00000000..92f74b3a --- /dev/null +++ b/.devcontainer/Dockerfile @@ -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 \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..39a69448 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -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" + } + } + } +} \ No newline at end of file diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml new file mode 100644 index 00000000..8e9eae62 --- /dev/null +++ b/.devcontainer/docker-compose.yml @@ -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"] \ No newline at end of file