Skip to content

Commit b85fa53

Browse files
.
1 parent cfa19a8 commit b85fa53

File tree

4 files changed

+102
-0
lines changed

4 files changed

+102
-0
lines changed

.devcontainer/vm/Dockerfile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# See here for image contents:
2+
# https://github.com/microsoft/vscode-dev-containers/tree/v0.148.1/containers/python-3/.devcontainer/base.Dockerfile
3+
ARG VARIANT="3.11"
4+
FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT}
5+
ARG INSTALL_NODE="true"
6+
ARG NODE_VERSION="lts/*"
7+
RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "source /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
8+
9+
USER vscode
10+
RUN pip3 --disable-pip-version-check --no-cache-dir install -U \
11+
'poetry==1.1.13' \
12+
'pip==22.1.2'
13+
# prevent homebrew from updating or upgrading to save time
14+
ENV HOMEBREW_NO_AUTO_UPDATE=1
15+
ENV HOMEBREW_NO_INSTALL_UPGRADE=1
16+
17+
WORKDIR /tmp
18+
RUN curl \
19+
-Lk \
20+
'https://code.visualstudio.com/sha/download?build=stable&os=cli-alpine-x64' \
21+
--output vscode_cli.tar.gz
22+
RUN sudo rm /usr/local/bin/code
23+
RUN sudo tar -xf vscode_cli.tar.gz -C /usr/local/bin
24+
25+
ENV TUNNEL_NAME=runpod
26+
ENV VSCODE_CLI_USE_FILE_KEYCHAIN=true
27+
28+
WORKDIR /home/vscode
29+
30+
COPY ./vm/start.sh /etc/start.sh
31+
CMD /etc/start.sh

.devcontainer/vm/devcontainer.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"name": "VM Devcontainer",
3+
"build": {
4+
"dockerfile": "Dockerfile",
5+
"context": "..",
6+
"args": {
7+
"VARIANT": "3.11",
8+
"INSTALL_NODE": "true",
9+
"NODE_VERSION": "18.7"
10+
}
11+
},
12+
"customizations": {
13+
"vscode": {
14+
"settings": {
15+
"terminal.integrated.defaultProfile.linux": "zsh",
16+
"python.pythonPath": "/usr/local/bin/python"
17+
},
18+
"extensions": [
19+
"ms-python.python"
20+
]
21+
}
22+
},
23+
"features": {
24+
"ghcr.io/devcontainers-contrib/features/starship:1": {},
25+
"ghcr.io/devcontainers/features/github-cli:1": {
26+
},
27+
},
28+
"mounts": [
29+
"source=${localEnv:HOME}${localEnv:USERPROFILE}/.ssh,target=/home/vscode/.ssh,type=bind,consistency=cached",
30+
"source=${localEnv:HOME}${localEnv:USERPROFILE}/.zsh_history,target=/home/vscode/.zsh_history,type=bind,consistency=cached",
31+
"source=${localEnv:HOME}${localEnv:USERPROFILE}/.zshrc,target=/home/vscode/.zshrc,type=bind,consistency=cached",
32+
"source=${localEnv:HOME}${localEnv:USERPROFILE}/.zshenv,target=/home/vscode/.zshenv,type=bind,consistency=cached",
33+
"source=${localEnv:HOME}${localEnv:USERPROFILE}/.config/starship.toml,target=/home/vscode/.config/starship.toml,type=bind,consistency=cached",
34+
"source=${localEnv:HOME}${localEnv:USERPROFILE}/.config/gh,target=/home/vscode/.config/gh,type=bind,consistency=cached",
35+
"source=${localEnv:HOME}${localEnv:USERPROFILE}/.gitconfig,target=/home/vscode/.gitconfig,type=bind,consistency=cached",
36+
],
37+
"remoteUser": "vscode"
38+
}

.devcontainer/vm/start.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#! /usr/bin/env bash
2+
3+
set -e -u -o pipefail -x
4+
5+
[ "$(stat -c %U .)" = "root" ] && sudo chown vscode:vscode /home/vscode
6+
7+
yes | \
8+
code tunnel \
9+
--accept-server-license-terms \
10+
--name ${TUNNEL_NAME} \
11+
--cli-data-dir /home/vscode/.vscode-cli

.github/workflows/build.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Pytest
2+
on:
3+
workflow_dispatch: {}
4+
jobs:
5+
build:
6+
runs-on: ubuntu-24.04
7+
permissions:
8+
contents: read
9+
packages: write
10+
steps:
11+
- uses: actions/checkout@v2
12+
- run: npm install -g @devcontainers/[email protected]
13+
- run: |
14+
set -e -x -u -o pipefail
15+
repo=ghcr.io/treebeardtech/dev-images; tag=latest
16+
docker pull hello-world
17+
docker tag hello-world $repo:$tag
18+
# devcontainer build \
19+
# --workspace-folder . \
20+
# --config .devcontainer/vm/devcontainer.json \
21+
# --image-name $repo:$tag
22+
docker push $repo:$tag

0 commit comments

Comments
 (0)