├── Dockerfile ├── README.md ├── bin ├── entrypoint.sh └── entrypoint_nonroot.sh ├── deployments └── kubernetes │ └── python │ └── deployment.yml ├── docker-compose.yml ├── docs └── minica.md └── versions ├── Dockerfile.base ├── Dockerfile.base_nonroot ├── Dockerfile.golang ├── Dockerfile.python └── Dockerfile.python_nonroot /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:11-slim 2 | 3 | ARG USER 4 | ARG UID 5 | ARG GID 6 | 7 | ENV CODE_SERVER_VERSION 4.9.1 8 | ENV HTTPS_ENABLED false 9 | ENV APP_BIND_HOST 0.0.0.0 10 | ENV APP_PORT 8080 11 | ENV USER ${USER} 12 | ENV UID ${UID} 13 | ENV GID ${GID} 14 | 15 | RUN apt update \ 16 | && apt install \ 17 | ca-certificates sudo curl dumb-init \ 18 | htop locales git procps ssh vim \ 19 | lsb-release wget openssl -y \ 20 | #&& curl -fsSL https://code-server.dev/install.sh | sh \ 21 | && wget https://github.com/cdr/code-server/releases/download/v${CODE_SERVER_VERSION}/code-server_${CODE_SERVER_VERSION}_amd64.deb \ 22 | && dpkg -i code-server_${CODE_SERVER_VERSION}_amd64.deb && rm -f code-server_${CODE_SERVER_VERSION}_amd64.deb \ 23 | && rm -rf /var/lib/apt/lists/* 24 | 25 | RUN sed -i "s/# en_US.UTF-8/en_US.UTF-8/" /etc/locale.gen && locale-gen 26 | ENV LANG en_US.UTF-8 27 | 28 | RUN chsh -s /bin/bash 29 | ENV SHELL /bin/bash 30 | 31 | RUN adduser --gecos '' --disabled-password coder \ 32 | && echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd 33 | 34 | RUN ARCH="$(dpkg --print-architecture)" \ 35 | && curl -fsSL "https://github.com/boxboat/fixuid/releases/download/v0.4.1/fixuid-0.4.1-linux-$ARCH.tar.gz" | tar -C /usr/local/bin -xzf - \ 36 | && chown root:root /usr/local/bin/fixuid \ 37 | && chmod 4755 /usr/local/bin/fixuid \ 38 | && mkdir -p /etc/fixuid \ 39 | && printf "user: coder\ngroup: coder\n" > /etc/fixuid/config.yml 40 | 41 | COPY bin/entrypoint.sh /usr/bin/entrypoint.sh 42 | RUN chmod +x /usr/bin/entrypoint.sh 43 | 44 | USER 1000 45 | ENV USER=coder 46 | WORKDIR /home/coder 47 | 48 | ENTRYPOINT ["/usr/bin/entrypoint.sh"] 49 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # docker-vscode-server 2 | 3 | Docker vscode server 4 | 5 | ## About 6 | 7 | This project is built for [github.com/bekkerlabs](https://github.com/bekkerlabs) which provides you with a environment of your choice, accessible via a web-based vscode. 8 | 9 | The main idea is, for example, if you want to learn mysql and python, the service will provision a environment with the required dependencies, and accessible via a web-based vscode with the markdown formatted labs to follow. 10 | 11 | In vscode your workspace folder by default will be opened in `/home/coder/workspace` and you can use your host user inside the container by passing the `--user` flag and using the `DOCKER_USER` environment variable. 12 | 13 | ## Usage 14 | 15 | You can either build it yourself or use my dockerhub images. 16 | 17 | The password is controlled by using the environment variable `PASSWORD`, if its not set, the password value will be in `~/.config/code-server/config.yaml` 18 | 19 | ### Note on persistence 20 | 21 | If you are using persistence, ensure the directories are owned by your user else you will get an error like this `error EACCES: permission denied`: 22 | 23 | ```bash 24 | $ mkdir workspace config 25 | $ sudo chown -R "$USER:$USER" config workspace 26 | ``` 27 | 28 | ### Build 29 | 30 | Building: 31 | 32 | ``` 33 | $ docker build \ 34 | --build-arg USER=${USER} \ 35 | --build-arg UID=${UID} \ 36 | --build-arg GID=${GID} \ 37 | -f Dockerfile -t vscode:default . 38 | ``` 39 | 40 | Running with no extensions, using http and port 8080: 41 | 42 | ``` 43 | $ docker run -it \ 44 | -e PASSWORD=password \ 45 | -e DOCKER_USER=${USER} \ 46 | -p 8080:8080 \ 47 | -u "$(id -u):$(id -g)" \ 48 | -v $PWD/workspace:/home/coder/workspace \ 49 | -v $PWD/config:/home/coder/.config \ 50 | vscode:default 51 | ``` 52 | 53 | Running with no extensions, using https and port 8443 (see [docs/minica](https://github.com/ruanbekker/docker-vscode-server/blob/main/docs/minica.md) to generate certs for local use): 54 | 55 | ``` 56 | $ docker run -it \ 57 | -e PASSWORD=password \ 58 | -e HTTPS_ENABLED=true \ 59 | -e APP_PORT=8443 \ 60 | -e DOCKER_USER=${USER} \ 61 | -p 8443:8443 \ 62 | -u "$(id -u):$(id -g)" \ 63 | -v $PWD/workspace:/home/coder/workspace \ 64 | -v $PWD/config:/home/coder/.config \ 65 | -v $PWD/certs/cert.pem:/home/coder/.certs/cert.pem \ 66 | -v $PWD/certs/key.pem:/home/coder/.certs/key.pem \ 67 | vscode:default 68 | ``` 69 | 70 | Running with extensions, using http and port 8080: 71 | 72 | ``` 73 | $ docker run -it \ 74 | -e PASSWORD=password \ 75 | -e DOCKER_USER=${USER} \ 76 | -e EXTENSIONS="ms-python.python,tushortz.python-extended-snippets,andyyaldoo.vscode-json,golang.go,redhat.vscode-yaml,vscode-icons-team.vscode-icons,HashiCorp.terraform,Tim-Koehler.helm-intellisense,Equinusocio.vsc-material-theme" 77 | -p 8080:8080 \ 78 | -u "$(id -u):$(id -g)" \ 79 | -v $PWD/workspace:/home/coder/workspace \ 80 | -v $PWD/config:/home/coder/.config \ 81 | vscode:default 82 | ``` 83 | 84 | ### Dockerhub Images 85 | 86 | Running with no extensions, using http and port 8080: 87 | 88 | ``` 89 | $ docker run -it \ 90 | -e PASSWORD=password \ 91 | -e DOCKER_USER=${USER} \ 92 | -p 8080:8080 \ 93 | -u "$(id -u):$(id -g)" \ 94 | -v $PWD/workspace:/home/coder/workspace \ 95 | -v $PWD/config:/home/coder/.config \ 96 | ruanbekker/vscode-server:slim 97 | ``` 98 | 99 | Running with no extensions, using https and port 8443 (see [docs/minica](https://github.com/ruanbekker/docker-vscode-server/blob/main/docs/minica.md) to generate certs for local use): 100 | 101 | ``` 102 | $ docker run -it \ 103 | -e PASSWORD=password \ 104 | -e HTTPS_ENABLED=true \ 105 | -e APP_PORT=8443 \ 106 | -e DOCKER_USER=${USER} \ 107 | -p 8443:8443 \ 108 | -u "$(id -u):$(id -g)" \ 109 | -v $PWD/workspace:/home/coder/workspace \ 110 | -v $PWD/config:/home/coder/.config \ 111 | -v $PWD/certs/cert.pem:/home/coder/.certs/cert.pem \ 112 | -v $PWD/certs/key.pem:/home/coder/.certs/key.pem \ 113 | ruanbekker/vscode-server:slim 114 | ``` 115 | 116 | Running with extensions, using http and port 8080: 117 | 118 | ``` 119 | $ docker run -it \ 120 | -e PASSWORD=password \ 121 | -e DOCKER_USER=${USER} \ 122 | -e EXTENSIONS="ms-python.python,tushortz.python-extended-snippets,andyyaldoo.vscode-json,golang.go,redhat.vscode-yaml,vscode-icons-team.vscode-icons" 123 | -p 8080:8080 \ 124 | -u "$(id -u):$(id -g)" \ 125 | -v $PWD/workspace:/home/coder/workspace \ 126 | -v $PWD/config:/home/coder/.config \ 127 | ruanbekker/vscode-server:slim 128 | ``` 129 | 130 | ### Persistence 131 | 132 | If you would like to persist your containers storage to your host for vscode's data, you can persist the follwing directories: 133 | 134 | * `-v $PWD/config:/home/coder/.config` (configuration) 135 | * `-v $PWD/userdata:/home/coder/.local` (logs, extensions, vscode settings, etc) 136 | 137 | ## Versions 138 | 139 | ### Slim 140 | 141 | Docker Image: 142 | 143 | - `ruanbekker/vscode-server:slim` 144 | 145 | This image is the smallest one which includes the following os packages: 146 | 147 | * `vim` 148 | * `git` 149 | * `curl` 150 | * `wget` 151 | * `ssh` 152 | 153 | ### Go 154 | 155 | Docker Image: 156 | 157 | - `ruanbekker/vscode-server:golang` 158 | 159 | This image uses Go version `1.15.6` 160 | 161 | ### Python 162 | 163 | Docker Image: 164 | 165 | - `ruanbekker/vscode-server:python` 166 | 167 | Includes the following python packages: 168 | 169 | * `virtualenv` 170 | * `requests` 171 | * `flask` 172 | * `pandas` 173 | * `numpy` 174 | * `sklearn` 175 | * `matplotlib` 176 | * `mysqlclient` 177 | * `pymysql` 178 | * `pysftp` 179 | 180 | ## Custom Builds 181 | 182 | You can extend or add your own software on-top of the base image by using `ruanbekker/vscode-server-base:3.7.4` as your base image. 183 | 184 | This is a sample: 185 | 186 | ``` 187 | FROM ruanbekker/vscode-server-base:3.7.4 188 | USER root 189 | 190 | # start of your custom modifications 191 | 192 | RUN apt update \ 193 | && apt install figlet-y \ 194 | && rm -rf /var/lib/apt/lists/* 195 | 196 | # end of your custom modifications 197 | 198 | USER 1000 199 | ENV USER=coder 200 | WORKDIR /home/coder 201 | 202 | ENTRYPOINT ["/usr/bin/entrypoint.sh"] 203 | ``` 204 | 205 | ## Docker Hub 206 | 207 | - [ruanbekker/vscode-server](https://hub.docker.com/r/ruanbekker/vscode-server) 208 | -------------------------------------------------------------------------------- /bin/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -eu 3 | 4 | export PS1='\w $ ' 5 | 6 | EXTENSIONS="${EXTENSIONS:-none}" 7 | LAB_REPO="${LAB_REPO:-none}" 8 | 9 | eval "$(fixuid -q)" 10 | 11 | mkdir -p /home/coder/workspace 12 | mkdir -p /home/coder/.local/share/code-server/User 13 | cat > /home/coder/.local/share/code-server/User/settings.json << EOF 14 | { 15 | "workbench.colorTheme": "Visual Studio Dark" 16 | } 17 | EOF 18 | chown coder /home/coder/workspace 19 | chown -R coder /home/coder/.local 20 | 21 | if [ "${DOCKER_USER-}" ]; then 22 | echo "$DOCKER_USER ALL=(ALL) NOPASSWD:ALL" | sudo tee -a /etc/sudoers.d/nopasswd > /dev/null 23 | sudo usermod --login "$DOCKER_USER" coder 24 | sudo groupmod -n "$DOCKER_USER" coder 25 | USER="$DOCKER_USER" 26 | sudo sed -i "/coder/d" /etc/sudoers.d/nopasswd 27 | fi 28 | 29 | if [ ${EXTENSIONS} != "none" ] 30 | then 31 | echo "Installing Extensions" 32 | for extension in $(echo ${EXTENSIONS} | tr "," "\n") 33 | do 34 | if [ "${extension}" != "" ] 35 | then 36 | dumb-init /usr/bin/code-server \ 37 | --install-extension "${extension}" \ 38 | /home/coder 39 | fi 40 | done 41 | fi 42 | 43 | if [ ${LAB_REPO} != "none" ] 44 | then 45 | cd workspace 46 | git clone ${LAB_REPO} 47 | cd .. 48 | fi 49 | 50 | if [ ${HTTPS_ENABLED} = "true" ] 51 | then 52 | dumb-init /usr/bin/code-server \ 53 | --bind-addr "${APP_BIND_HOST}":"${APP_PORT}" \ 54 | --cert /home/coder/.certs/cert.pem \ 55 | --cert-key /home/coder/.certs/key.pem \ 56 | /home/coder/workspace 57 | else 58 | dumb-init /usr/bin/code-server \ 59 | --bind-addr "${APP_BIND_HOST}":"${APP_PORT}" \ 60 | /home/coder/workspace 61 | fi 62 | -------------------------------------------------------------------------------- /bin/entrypoint_nonroot.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -eu 3 | 4 | EXTENSIONS="${EXTENSIONS:-none}" 5 | 6 | eval "$(fixuid -q)" 7 | 8 | mkdir -p /home/coder/workspace 9 | mkdir -p /home/coder/.local/share/code-server/User 10 | cat > /home/coder/.local/share/code-server/User/settings.json << EOF 11 | { 12 | "workbench.colorTheme": "Visual Studio Dark" 13 | } 14 | EOF 15 | chown coder /home/coder/workspace 16 | chown -R coder /home/coder/.local 17 | 18 | if [ "${DOCKER_USER-}" ]; then 19 | #sudo usermod --login "$DOCKER_USER" coder 20 | #sudo groupmod -n "$DOCKER_USER" coder 21 | USER="$DOCKER_USER" 22 | fi 23 | 24 | if [ ${EXTENSIONS} != "none" ] 25 | then 26 | echo "Installing Extensions" 27 | for extension in $(echo ${EXTENSIONS} | tr "," "\n") 28 | do 29 | if [ "${extension}" != "" ] 30 | then 31 | dumb-init /usr/bin/code-server \ 32 | --install-extension "${extension}" \ 33 | /home/coder 34 | fi 35 | done 36 | fi 37 | 38 | if [ ${HTTPS_ENABLED} = "true" ] 39 | then 40 | dumb-init /usr/bin/code-server \ 41 | --bind-addr "${APP_BIND_HOST}":"${APP_PORT}" \ 42 | --cert /home/coder/.certs/cert.pem \ 43 | --cert-key /home/coder/.certs/key.pem \ 44 | /home/coder/workspace 45 | else 46 | dumb-init /usr/bin/code-server \ 47 | --bind-addr "${APP_BIND_HOST}":"${APP_PORT}" \ 48 | /home/coder/workspace 49 | fi 50 | -------------------------------------------------------------------------------- /deployments/kubernetes/python/deployment.yml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: v1 3 | kind: PersistentVolume 4 | metadata: 5 | name: python-test-pv 6 | labels: 7 | type: local 8 | app: python-test 9 | spec: 10 | storageClassName: manual 11 | capacity: 12 | storage: 1Gi 13 | accessModes: 14 | - ReadWriteOnce 15 | hostPath: 16 | path: "/tmp/python-test" 17 | --- 18 | apiVersion: v1 19 | kind: PersistentVolumeClaim 20 | metadata: 21 | name: python-test-pvc 22 | spec: 23 | storageClassName: manual 24 | accessModes: 25 | - ReadWriteOnce 26 | resources: 27 | requests: 28 | storage: 1Gi 29 | --- 30 | apiVersion: apps/v1 31 | kind: Deployment 32 | metadata: 33 | name: lab-python-test 34 | labels: 35 | app: python-test 36 | spec: 37 | replicas: 1 38 | selector: 39 | matchLabels: 40 | app: python-test 41 | template: 42 | metadata: 43 | labels: 44 | app: python-test 45 | spec: 46 | securityContext: 47 | runAsUser: 1002 48 | runAsGroup: 1002 49 | #fsGroup: 2000 50 | volumes: 51 | - name: python-test-storage 52 | persistentVolumeClaim: 53 | claimName: python-test-pvc 54 | containers: 55 | - name: python-test 56 | image: ruanbekker/vscode-server:python 57 | imagePullPolicy: Always 58 | env: 59 | - name: APP_PORT 60 | value: "8080" 61 | - name: DOCKER_USER 62 | value: "labs" 63 | - name: PASSWORD 64 | value: "password" 65 | - name: EXTENSIONS 66 | value: "tushortz.python-extended-snippets,vscode-icons-team.vscode-icons" 67 | ports: 68 | - containerPort: 8080 69 | volumeMounts: 70 | - mountPath: "/home/coder/workspace" 71 | name: python-test-storage 72 | resources: 73 | limits: 74 | cpu: "1" 75 | memory: "256Mi" 76 | requests: 77 | cpu: 500m 78 | memory: "128Mi" 79 | #command: [ "sh", "-c", "sleep 1h" ] 80 | --- 81 | apiVersion: v1 82 | kind: Service 83 | metadata: 84 | name: python-test-svc 85 | namespace: default 86 | spec: 87 | ports: 88 | - name: http 89 | targetPort: 8080 90 | port: 80 91 | selector: 92 | app: python-test 93 | --- 94 | apiVersion: extensions/v1beta1 95 | kind: Ingress 96 | metadata: 97 | name: python-test 98 | namespace: default 99 | annotations: 100 | kubernetes.io/ingress.class: traefik 101 | ingress.kubernetes.io/ssl-redirect: "false" 102 | traefik.backend.loadbalancer.stickiness: "true" 103 | spec: 104 | rules: 105 | - host: 127.0.0.1.nip.io 106 | http: 107 | paths: 108 | - path: / 109 | backend: 110 | serviceName: python-test-svc 111 | servicePort: http 112 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | services: 3 | vscode: 4 | build: 5 | context: . 6 | dockerfile: Dockerfile 7 | args: 8 | USER: $USER 9 | UID: $UID 10 | GID: $GID 11 | environment: 12 | - PASSWORD=password 13 | - DOCKER_USER=${USER} 14 | - HTTPS_ENABLED=true 15 | - APP_PORT=8443 16 | - APP_BIND_HOST=0.0.0.0 17 | - EXTENSIONS=ms-python.python,ms-toolsai.jupyter,tushortz.python-extended-snippets,andyyaldoo.vscode-json,golang.go,redhat.vscode-yaml,vscode-icons-team.vscode-icons 18 | user: "$UID:$GID" 19 | volumes: 20 | - $PWD/workspace:/home/coder/workspace 21 | - $PWD/config:/home/coder/.config 22 | - $PWD/certs:/home/coder/.certs 23 | ports: 24 | - 8443:8443 25 | -------------------------------------------------------------------------------- /docs/minica.md: -------------------------------------------------------------------------------- 1 | # MiniCA 2 | 3 | ## About 4 | 5 | Project Info: 6 | - [jsha/minica](https://github.com/jsha/minica) 7 | 8 | ## Usage 9 | 10 | Run: 11 | 12 | ``` 13 | $ docker run --user "$(id -u):$(id -g)" -it -v $PWD/certs:/output ruanbekker/minica --domains 192.168.0.20.nip.io 14 | ``` 15 | 16 | View: 17 | 18 | ``` 19 | $ find ./certs -type f 20 | ./certs/minica-key.pem 21 | ./certs/192.168.0.20.nip.io/key.pem 22 | ./certs/192.168.0.20.nip.io/cert.pem 23 | ./certs/minica.pem 24 | ``` 25 | 26 | ## Cert Installation 27 | 28 | Follow [this guide](https://gist.github.com/mwidmann/115c2a7059dcce300b61f625d887e5dc) for cert installation 29 | -------------------------------------------------------------------------------- /versions/Dockerfile.base: -------------------------------------------------------------------------------- 1 | FROM debian:11 2 | 3 | ARG USER 4 | ARG UID 5 | ARG GID 6 | 7 | ENV CODE_SERVER_VERSION 4.9.1 8 | ENV HTTPS_ENABLED false 9 | ENV APP_BIND_HOST 0.0.0.0 10 | ENV APP_PORT 8080 11 | ENV USER ${USER} 12 | ENV UID ${UID} 13 | ENV GID ${GID} 14 | ENV PS1='\w $ ' 15 | 16 | RUN apt update \ 17 | && apt install \ 18 | ca-certificates openssl sudo curl dumb-init \ 19 | htop locales git procps ssh vim lsb-release \ 20 | wget netcat -y \ 21 | && wget https://github.com/cdr/code-server/releases/download/v${CODE_SERVER_VERSION}/code-server_${CODE_SERVER_VERSION}_amd64.deb \ 22 | && dpkg -i code-server_${CODE_SERVER_VERSION}_amd64.deb && rm -f code-server_${CODE_SERVER_VERSION}_amd64.deb \ 23 | && rm -rf /var/lib/apt/lists/* 24 | 25 | RUN sed -i "s/# en_US.UTF-8/en_US.UTF-8/" /etc/locale.gen && locale-gen 26 | ENV LANG en_US.UTF-8 27 | 28 | RUN chsh -s /bin/bash 29 | ENV SHELL /bin/bash 30 | 31 | RUN adduser --gecos '' --disabled-password coder \ 32 | && echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd 33 | 34 | RUN ARCH="$(dpkg --print-architecture)" \ 35 | && curl -fsSL "https://github.com/boxboat/fixuid/releases/download/v0.4.1/fixuid-0.4.1-linux-$ARCH.tar.gz" | tar -C /usr/local/bin -xzf - \ 36 | && chown root:root /usr/local/bin/fixuid \ 37 | && chmod 4755 /usr/local/bin/fixuid \ 38 | && mkdir -p /etc/fixuid \ 39 | && printf "user: coder\ngroup: coder\n" > /etc/fixuid/config.yml 40 | 41 | COPY bin/entrypoint.sh /usr/bin/entrypoint.sh 42 | RUN chmod +x /usr/bin/entrypoint.sh 43 | 44 | USER 1000 45 | ENV USER=coder 46 | WORKDIR /home/coder 47 | 48 | -------------------------------------------------------------------------------- /versions/Dockerfile.base_nonroot: -------------------------------------------------------------------------------- 1 | FROM debian:10 2 | 3 | ARG USER 4 | ARG UID 5 | ARG GID 6 | 7 | ENV CODE_SERVER_VERSION 3.8.0 8 | ENV HTTPS_ENABLED false 9 | ENV APP_BIND_HOST 0.0.0.0 10 | ENV APP_PORT 8080 11 | ENV USER ${USER} 12 | ENV UID ${UID} 13 | ENV GID ${GID} 14 | ENV PS1='\w $ ' 15 | 16 | RUN apt update \ 17 | && apt install \ 18 | ca-certificates openssl sudo curl dumb-init \ 19 | htop locales git procps ssh vim lsb-release \ 20 | wget netcat -y \ 21 | && wget https://github.com/cdr/code-server/releases/download/v${CODE_SERVER_VERSION}/code-server_${CODE_SERVER_VERSION}_amd64.deb \ 22 | && dpkg -i code-server_${CODE_SERVER_VERSION}_amd64.deb && rm -f code-server_${CODE_SERVER_VERSION}_amd64.deb \ 23 | && rm -rf /var/lib/apt/lists/* 24 | 25 | RUN sed -i "s/# en_US.UTF-8/en_US.UTF-8/" /etc/locale.gen && locale-gen 26 | ENV LANG en_US.UTF-8 27 | 28 | RUN chsh -s /bin/bash 29 | ENV SHELL /bin/bash 30 | 31 | RUN adduser --gecos '' --disabled-password coder 32 | 33 | RUN ARCH="$(dpkg --print-architecture)" \ 34 | && curl -fsSL "https://github.com/boxboat/fixuid/releases/download/v0.4.1/fixuid-0.4.1-linux-$ARCH.tar.gz" | tar -C /usr/local/bin -xzf - \ 35 | && chown root:root /usr/local/bin/fixuid \ 36 | && chmod 4755 /usr/local/bin/fixuid \ 37 | && mkdir -p /etc/fixuid \ 38 | && printf "user: coder\ngroup: coder\n" > /etc/fixuid/config.yml 39 | 40 | COPY bin/entrypoint_nonroot.sh /usr/bin/entrypoint.sh 41 | RUN chmod +x /usr/bin/entrypoint.sh 42 | 43 | USER 1000 44 | ENV USER=coder 45 | WORKDIR /home/coder 46 | 47 | -------------------------------------------------------------------------------- /versions/Dockerfile.golang: -------------------------------------------------------------------------------- 1 | FROM ruanbekker/vscode-server-base:3.7.4 2 | 3 | USER root 4 | 5 | ENV GO_VERSION 1.15.6 6 | ENV PATH /usr/local/go/bin:$PATH 7 | ENV GOPATH /home/coder/go 8 | ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH 9 | RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" 10 | 11 | RUN apt update \ 12 | && apt install gcc musl-dev -y \ 13 | && rm -rf /var/lib/apt/lists/* 14 | 15 | RUN wget -O go.tgz "https://golang.org/dl/go$GO_VERSION.linux-amd64.tar.gz" \ 16 | && tar -C /usr/local -xzf go.tgz \ 17 | && rm -f go.tgz 18 | 19 | USER 1000 20 | ENV USER=coder 21 | WORKDIR /home/coder 22 | 23 | ENTRYPOINT ["/usr/bin/entrypoint.sh"] 24 | -------------------------------------------------------------------------------- /versions/Dockerfile.python: -------------------------------------------------------------------------------- 1 | FROM ruanbekker/vscode-server-base:4.9.1 2 | 3 | USER root 4 | 5 | RUN apt update \ 6 | && apt install \ 7 | python3 python3-dev python3-pip \ 8 | libmariadb-dev -y \ 9 | && rm -rf /var/lib/apt/lists/* 10 | 11 | RUN ln -fs /usr/bin/pip3 /usr/bin/pip \ 12 | && ln -fs /usr/bin/python3 /usr/bin/python 13 | 14 | RUN pip install requests virtualenv flask \ 15 | pandas sklearn numpy matplotlib 16 | 17 | RUN pip install mysqlclient pymysql pysftp pymongo \ 18 | mongoengine 19 | 20 | USER 1000 21 | ENV USER=coder 22 | WORKDIR /home/coder 23 | 24 | ENTRYPOINT ["/usr/bin/entrypoint.sh"] 25 | -------------------------------------------------------------------------------- /versions/Dockerfile.python_nonroot: -------------------------------------------------------------------------------- 1 | FROM ruanbekker/vscode-server-base:3.8.0-nonroot 2 | 3 | USER root 4 | 5 | RUN apt update \ 6 | && apt install \ 7 | python3 python3-dev python3-pip \ 8 | libmariadb-dev -y \ 9 | && rm -rf /var/lib/apt/lists/* 10 | 11 | RUN ln -s /usr/bin/pip3 /usr/bin/pip \ 12 | && ln -s /usr/bin/python3 /usr/bin/python \ 13 | && pip install \ 14 | requests virtualenv flask pandas \ 15 | mysqlclient pymysql pysftp sklearn \ 16 | numpy matplotlib pymongo mongoengine 17 | 18 | USER 1000 19 | ENV USER=coder 20 | WORKDIR /home/coder 21 | 22 | ENTRYPOINT ["/usr/bin/entrypoint.sh"] 23 | --------------------------------------------------------------------------------