├── renovate.json ├── entrypoint ├── entrypoint.satlus ├── .github ├── FUNDING.yml └── main.workflow ├── exec-v2 ├── ubuntu.Dockerfile ├── vanilla.Dockerfile ├── README.md ├── v2.dockerfile ├── openshift.Dockerfile ├── v2-openshift.dockerfile ├── che-v2.dockerfile ├── satlus.Dockerfile ├── .circleci └── config.yml └── exec /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "config:base" 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /entrypoint: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | export HOME=/home/coder 4 | export PASSWORD=$CODER_PASSWORD 5 | export USER_ID=$(id -u) 6 | export GROUP_ID=$(id -g) 7 | 8 | if [ -w /etc/passwd ]; then 9 | echo "user:x:$(id -u):$(id -g):user user:${HOME}:/bin/bash" >> /etc/passwd 10 | fi 11 | exec "$@" 12 | -------------------------------------------------------------------------------- /entrypoint.satlus: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export HOME=/home/coder 4 | 5 | if [[ -z $FIXUID ]]; 6 | then 7 | echo "fixuid flag not set..." 8 | else 9 | echo "fixuid is set..." 10 | if [[ -z $FIXUID_QUIET ]]; 11 | then 12 | fixuid 13 | else 14 | fixuid -q 15 | fi 16 | fi 17 | 18 | echo "starting coder..." 19 | exec "$@" -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: 4 | - sr229 # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 5 | patreon: capuccino # Replace with a single Patreon username 6 | open_collective: # Replace with a single Open Collective username 7 | ko_fi: # Replace with a single Ko-fi username 8 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 9 | custom: https://paypal.me/chinodesuuu # Replace with a single custom sponsorship URL 10 | -------------------------------------------------------------------------------- /exec-v2: -------------------------------------------------------------------------------- 1 | #!/usr/bin/dumb-init /bin/sh 2 | 3 | # Special exec script to handle user cases that needs auth or 4 | # stuff I can think of. 5 | 6 | # check for $CODER_ENABLE_AUTH. 7 | case "${CODER_ENABLE_AUTH}" in 8 | true) 9 | case "${CODER_ENABLE_TLS}" in 10 | true) 11 | PASSWORD="${CODER_PASSWORD}" \ 12 | /usr/bin/code-server --port=9000 --cert=/home/coder/certs/cert.crt --cert-key=/home/coder/certs/cert.key 13 | ;; 14 | *) 15 | PASSWORD="${CODER_PASSWORD}" \ 16 | /usr/bin/code-server --port=9000 17 | ;; 18 | esac 19 | ;; 20 | *) 21 | case "${CODER_ENABLE_TLS}" in 22 | true) 23 | /usr/bin/code-server --port=9000 --cert=/home/coder/certs/cert.crt --cert-key=/home/coder/certs/cert.key --auth=none 24 | ;; 25 | *) 26 | /usr/bin/code-server --port=9000 --auth=none 27 | ;; 28 | esac 29 | ;; 30 | esac -------------------------------------------------------------------------------- /.github/main.workflow: -------------------------------------------------------------------------------- 1 | workflow "Build and Deploy" { 2 | resolves = [ 3 | "Push Image", 4 | "GitHub Action for Docker", 5 | ] 6 | on = "release" 7 | } 8 | 9 | action "GitHub Action for Docker" { 10 | uses = "actions/docker/cli@8cdf801b322af5f369e00d85e9cf3a7122f49108" 11 | args = "build -t chinodesuuuu/coder:latest ." 12 | } 13 | 14 | action "Docker Registry" { 15 | uses = "actions/docker/login@8cdf801b322af5f369e00d85e9cf3a7122f49108" 16 | needs = ["GitHub Action for Docker"] 17 | secrets = ["DOCKER_USERNAME", "DOCKER_PASSWORD"] 18 | } 19 | 20 | action "Push Image" { 21 | uses = "actions/docker/cli@8cdf801b322af5f369e00d85e9cf3a7122f49108" 22 | needs = ["Docker Registry"] 23 | args = "docker push -t chinodesuuu/coder:latest" 24 | } 25 | 26 | workflow "Lint PR" { 27 | on = "pull_request" 28 | resolves = ["Build Image"] 29 | } 30 | 31 | action "Build Image" { 32 | uses = "actions/docker/cli@8cdf801b322af5f369e00d85e9cf3a7122f49108" 33 | args = "build -t pr ." 34 | } 35 | -------------------------------------------------------------------------------- /ubuntu.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:18.04 2 | 3 | ENV LANG=en_US.UTF-8 \ 4 | # adding a sane default is needed since we're not erroring out via exec. 5 | CODER_PASSWORD="coder" 6 | 7 | #Change this via --arg in Docker CLI 8 | ARG CODER_VERSION=1.1156-vsc1.33.1 9 | 10 | COPY exec /opt 11 | 12 | RUN apt-get update && \ 13 | apt-get install -y \ 14 | sudo \ 15 | openssl \ 16 | net-tools \ 17 | git \ 18 | locales \ 19 | curl \ 20 | dumb-init \ 21 | wget && \ 22 | locale-gen en_US.UTF-8 && \ 23 | apt clean && \ 24 | rm -rf /var/lib/apt/lists/* && \ 25 | cd /tmp && \ 26 | wget -O - https://github.com/codercom/code-server/releases/download/${CODER_VERSION}/code-server${CODER_VERSION}-linux-x64.tar.gz | tar -xzv && \ 27 | chmod -R 755 code-server${CODER_VERSION}-linux-x64/code-server && \ 28 | mv code-server${CODER_VERSION}-linux-x64/code-server /usr/bin/ && \ 29 | rm -rf code-server${CODER_VERSION}-linux-x64 && \ 30 | adduser --disabled-password --gecos '' coder && \ 31 | echo '%sudo ALL=(ALL:ALL) NOPASSWD:ALL' >> /etc/sudoers && \ 32 | echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd; 33 | 34 | WORKDIR /home/coder 35 | 36 | USER coder 37 | 38 | RUN mkdir -p projects && mkdir -p certs && \ 39 | curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash && \ 40 | sudo chmod -R g+rw projects/ && \ 41 | sudo chmod -R g+rw certs/ && \ 42 | sudo chmod -R 755 /opt/exec; 43 | 44 | VOLUME ["/home/coder/projects", "/home/coder/certs"]; 45 | 46 | EXPOSE 9000 47 | 48 | CMD ["/opt/exec"] 49 | -------------------------------------------------------------------------------- /vanilla.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:buster-slim 2 | 3 | ENV LANG=en_US.UTF-8 \ 4 | # adding a sane default is needed since we're not erroring out via exec. 5 | CODER_PASSWORD="coder" 6 | 7 | #Change this via --arg in Docker CLI 8 | ARG CODER_VERSION=1.1156-vsc1.33.1 9 | 10 | COPY exec /opt 11 | 12 | RUN apt-get update && \ 13 | apt-get install -y \ 14 | sudo \ 15 | openssl \ 16 | net-tools \ 17 | git \ 18 | locales \ 19 | curl \ 20 | dumb-init \ 21 | wget && \ 22 | locale-gen en_US.UTF-8 && \ 23 | apt clean && \ 24 | rm -rf /var/lib/apt/lists/* && \ 25 | cd /tmp && \ 26 | wget -O - https://github.com/codercom/code-server/releases/download/${CODER_VERSION}/code-server${CODER_VERSION}-linux-x64.tar.gz | tar -xzv && \ 27 | chmod -R 755 code-server${CODER_VERSION}-linux-x64/code-server && \ 28 | mv code-server${CODER_VERSION}-linux-x64/code-server /usr/bin/ && \ 29 | rm -rf code-server${CODER_VERSION}-linux-x64 && \ 30 | adduser --disabled-password --gecos '' coder && \ 31 | echo '%sudo ALL=(ALL:ALL) NOPASSWD:ALL' >> /etc/sudoers && \ 32 | echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd; 33 | 34 | WORKDIR /home/coder 35 | 36 | USER coder 37 | 38 | RUN mkdir -p projects && mkdir -p certs && \ 39 | curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash && \ 40 | sudo chmod -R g+rw projects/ && \ 41 | sudo chmod -R g+rw certs/ && \ 42 | sudo chmod -R 755 /opt/exec; 43 | 44 | VOLUME ["/home/coder/projects", "/home/coder/certs"]; 45 | 46 | EXPOSE 9000 47 | 48 | CMD ["/opt/exec"] 49 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Coder in Docker 2 | 3 | [[Try the Demo](https://labs.play-with-docker.com/?stack=https://gist.githubusercontent.com/sr229/fbb05dfb1e3cb8ec8dc0f9ad8976f40c/raw/d34635e38a8dcf9b29e0cc7c70819de4093077f5/docker-stack.yml)] 4 | 5 | This is a distribution of Coder's [Visual Studio Code in browser](https://github.com/codercom/code-server) designed to work for CNCF-compliant orchestators. 6 | 7 | ## Running 8 | 9 | We maintain two tags that has a specific container orchestrator usage. 10 | 11 | - For OpenShift use the `chinodesuuu/coder:openshift` image. 12 | - Kubernetes and anything else can use the `chinodesuuu/coder:vanilla`/`chinodesuuu/coder:latest` image. 13 | - A codercom-like stack is `chinodesuuu/coder:ubuntu` image. This does not work in OpenShift, unfortunately. 14 | 15 | > Keep in mind that Coder in Kubernetes does not play well with non-PVC mounts, `sudo` tends to fail to work with the volume mount on `hostMount` or NFS volumes, so make sure you set `nosuid` for the mount. 16 | 17 | After the pull has been done, make sure you bound to port 9000 and mount a volume in `/home/coder/projects`. 18 | 19 | ## Enabling SSL or Auth 20 | 21 | to enable auth, make sure you set the environment variable `CODER_ENABLE_AUTH` to true. 22 | 23 | when `CODER_ENABLE_AUTH` is set to true, you must provide your password via `CODER_PASSWORD` else, it defaults to "coder". 24 | 25 | To enable SSL, mount your certificates' dir to `/home/coder/certs` and set `CODER_ENABLE_SSL` to true. 26 | 27 | Keep in mind for SSL, your files should be named as follows: 28 | 29 | - `coder.crt` for the Certificate chain. 30 | - `coder.key` for the Certificate key. 31 | 32 | If you didn't name your files as such - it will be invalid and Coder will refuse to work. 33 | -------------------------------------------------------------------------------- /v2.dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:buster-slim 2 | 3 | ENV LANG=en_US.UTF-8 \ 4 | # adding a sane default is needed since we're not erroring out via exec. 5 | CODER_PASSWORD="coder" \ 6 | SHELL=/bin/bash 7 | 8 | #Change this via --arg in Docker CLI 9 | ARG CODER_VERSION=2.1523-vsc1.38.1 10 | 11 | COPY exec-v2 /opt/exec 12 | 13 | RUN apt-get update && \ 14 | apt-get install -y \ 15 | sudo \ 16 | openssl \ 17 | net-tools \ 18 | git \ 19 | locales \ 20 | curl \ 21 | dumb-init \ 22 | wget && \ 23 | locale-gen en_US.UTF-8 && \ 24 | apt clean && \ 25 | rm -rf /var/lib/apt/lists/* && \ 26 | cd /tmp && \ 27 | wget -O - https://github.com/codercom/code-server/releases/download/${CODER_VERSION}/code-server${CODER_VERSION}-linux-x86_64.tar.gz | tar -xzv && \ 28 | chmod -R 755 code-server${CODER_VERSION}-linux-x86_64/code-server && \ 29 | mv code-server${CODER_VERSION}-linux-x86_64/code-server /usr/bin/ && \ 30 | rm -rf code-server-${CODER_VERSION}-linux-x86_64 && \ 31 | adduser --disabled-password --gecos '' coder && \ 32 | echo '%sudo ALL=(ALL:ALL) NOPASSWD:ALL' >> /etc/sudoers && \ 33 | echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd && \ 34 | chmod g+rw /home/coder && \ 35 | chmod a+x /opt/exec && \ 36 | chgrp -R 0 /home/coder && \ 37 | chmod -R g=u /home/coder && \ 38 | chmod g=u /etc/passwd; 39 | 40 | WORKDIR /home/coder 41 | 42 | USER coder 43 | 44 | RUN mkdir -p projects && mkdir -p certs && \ 45 | curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash && \ 46 | sudo chmod -R g+rw projects/ && \ 47 | sudo chmod -R g+rw certs/ && \ 48 | sudo chmod -R g+rw .nvm; 49 | 50 | COPY entrypoint /home/coder 51 | 52 | VOLUME ["/home/coder/projects", "/home/coder/certs"]; 53 | 54 | USER 1000 55 | 56 | EXPOSE 9000 57 | 58 | CMD ["/opt/exec"] -------------------------------------------------------------------------------- /openshift.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:buster-slim 2 | 3 | ENV LANG=en_US.UTF-8 \ 4 | # adding a sane default is needed since we're not erroring out via exec. 5 | CODER_PASSWORD="coder" 6 | 7 | #Change this via --arg in Docker CLI 8 | ARG CODER_VERSION=1.1156-vsc1.33.1 9 | 10 | COPY exec /opt 11 | 12 | RUN apt-get update && \ 13 | apt-get install -y \ 14 | sudo \ 15 | openssl \ 16 | net-tools \ 17 | git \ 18 | locales \ 19 | curl \ 20 | dumb-init \ 21 | wget && \ 22 | locale-gen en_US.UTF-8 && \ 23 | apt clean && \ 24 | rm -rf /var/lib/apt/lists/* && \ 25 | cd /tmp && \ 26 | wget -O - https://github.com/codercom/code-server/releases/download/${CODER_VERSION}/code-server${CODER_VERSION}-linux-x64.tar.gz | tar -xzv && \ 27 | chmod -R 755 code-server${CODER_VERSION}-linux-x64/code-server && \ 28 | mv code-server${CODER_VERSION}-linux-x64/code-server /usr/bin/ && \ 29 | rm -rf code-server-${CODER_VERSION}-linux-x64 && \ 30 | adduser --disabled-password --gecos '' coder && \ 31 | echo '%sudo ALL=(ALL:ALL) NOPASSWD:ALL' >> /etc/sudoers && \ 32 | echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd && \ 33 | chmod g+rw /home/coder && \ 34 | chmod a+x /opt/exec && \ 35 | chgrp -R 0 /home/coder && \ 36 | chmod -R g=u /home/coder && \ 37 | chmod g=u /etc/passwd; 38 | 39 | WORKDIR /home/coder 40 | 41 | USER coder 42 | 43 | RUN mkdir -p projects && mkdir -p certs && \ 44 | curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash && \ 45 | sudo chmod -R g+rw projects/ && \ 46 | sudo chmod -R g+rw certs/ && \ 47 | sudo chmod -R g+rw .nvm; 48 | 49 | COPY entrypoint /home/coder 50 | 51 | VOLUME ["/home/coder/projects", "/home/coder/certs"]; 52 | 53 | USER 10001 54 | 55 | ENTRYPOINT ["/home/coder/entrypoint"] 56 | 57 | EXPOSE 9000 58 | 59 | CMD ["/opt/exec"] 60 | -------------------------------------------------------------------------------- /v2-openshift.dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:buster-slim 2 | 3 | ENV LANG=en_US.UTF-8 \ 4 | # adding a sane default is needed since we're not erroring out via exec. 5 | CODER_PASSWORD="coder" \ 6 | SHELL=/bin/bash 7 | 8 | #Change this via --arg in Docker CLI 9 | ARG CODER_VERSION=2.1523-vsc1.38.1 10 | 11 | COPY exec-v2 /opt/exec 12 | 13 | RUN apt-get update && \ 14 | apt-get install -y \ 15 | sudo \ 16 | openssl \ 17 | net-tools \ 18 | git \ 19 | locales \ 20 | curl \ 21 | dumb-init \ 22 | wget && \ 23 | locale-gen en_US.UTF-8 && \ 24 | apt clean && \ 25 | rm -rf /var/lib/apt/lists/* && \ 26 | cd /tmp && \ 27 | wget -O - https://github.com/codercom/code-server/releases/download/${CODER_VERSION}/code-server${CODER_VERSION}-linux-x86_64.tar.gz | tar -xzv && \ 28 | chmod -R 755 code-server${CODER_VERSION}-linux-x86_64/code-server && \ 29 | mv code-server${CODER_VERSION}-linux-x86_64/code-server /usr/bin/ && \ 30 | rm -rf code-server-${CODER_VERSION}-linux-x86_64 && \ 31 | adduser --disabled-password --gecos '' coder && \ 32 | echo '%sudo ALL=(ALL:ALL) NOPASSWD:ALL' >> /etc/sudoers && \ 33 | echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd && \ 34 | chmod g+rw /home/coder && \ 35 | chmod a+x /opt/exec && \ 36 | chgrp -R 0 /home/coder && \ 37 | chmod -R g=u /home/coder && \ 38 | chmod g=u /etc/passwd; 39 | 40 | WORKDIR /home/coder 41 | 42 | USER coder 43 | 44 | RUN mkdir -p projects && mkdir -p certs && \ 45 | curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash && \ 46 | sudo chmod -R g+rw projects/ && \ 47 | sudo chmod -R g+rw certs/ && \ 48 | sudo chmod -R g+rw .nvm; 49 | 50 | COPY entrypoint /home/coder 51 | 52 | VOLUME ["/home/coder/projects", "/home/coder/certs"]; 53 | 54 | USER 10001 55 | 56 | ENTRYPOINT ["/home/coder/entrypoint"] 57 | 58 | EXPOSE 9000 59 | 60 | CMD ["/opt/exec"] -------------------------------------------------------------------------------- /che-v2.dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:buster-slim 2 | 3 | ENV LANG=en_US.UTF-8 \ 4 | # adding a sane default is needed since we're not erroring out via exec. 5 | CODER_PASSWORD="coder" \ 6 | SHELL=/bin/bash 7 | 8 | #Change this via --arg in Docker CLI 9 | ARG CODER_VERSION=2.1523-vsc1.38.1 10 | 11 | COPY exec-v2 /opt/exec 12 | 13 | RUN apt-get update && \ 14 | apt-get install -y \ 15 | sudo \ 16 | openssl \ 17 | net-tools \ 18 | git \ 19 | locales \ 20 | curl \ 21 | dumb-init \ 22 | wget && \ 23 | locale-gen en_US.UTF-8 && \ 24 | apt clean && \ 25 | rm -rf /var/lib/apt/lists/* && \ 26 | cd /tmp && \ 27 | wget -O - https://github.com/codercom/code-server/releases/download/${CODER_VERSION}/code-server${CODER_VERSION}-linux-x86_64.tar.gz | tar -xzv && \ 28 | chmod -R 755 code-server${CODER_VERSION}-linux-x86_64/code-server && \ 29 | mv code-server${CODER_VERSION}-linux-x86_64/code-server /usr/bin/ && \ 30 | rm -rf code-server-${CODER_VERSION}-linux-x86_64 && \ 31 | adduser --disabled-password --gecos '' coder && \ 32 | echo '%sudo ALL=(ALL:ALL) NOPASSWD:ALL' >> /etc/sudoers && \ 33 | echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd && \ 34 | mkdir /projects && \ 35 | chmod g+rw /projects && \ 36 | chown coder:coder /projects &&\ 37 | chgrp -R 0 /projects && \ 38 | chmod -R g=u /projects && \ 39 | chmod g+rw /home/coder && \ 40 | chmod a+x /opt/exec && \ 41 | chgrp -R 0 /home/coder && \ 42 | chmod -R g=u /home/coder && \ 43 | chmod g=u /etc/passwd; 44 | 45 | WORKDIR /home/coder 46 | 47 | USER coder 48 | 49 | RUN mkdir -p projects && mkdir -p certs && \ 50 | curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash && \ 51 | sudo chmod -R g+rw projects/ && \ 52 | sudo chmod -R g+rw certs/ && \ 53 | sudo chmod -R g+rw .nvm; 54 | 55 | COPY entrypoint /home/coder 56 | 57 | USER 10001 58 | 59 | ENTRYPOINT ["/home/coder/entrypoint"] 60 | 61 | EXPOSE 9000 62 | 63 | WORKDIR /projects 64 | 65 | CMD [ "dumb-init", "/usr/bin/code-server", "--port=9000", "/projects"] -------------------------------------------------------------------------------- /satlus.Dockerfile: -------------------------------------------------------------------------------- 1 | # Dockerfile based from satlus's PR. 2 | # Intended for testing purposes, see PR: https://github.com/cdr/code-server/pull/640 3 | FROM debian:buster-slim 4 | 5 | ENV LANG=en_US.UTF-8 \ 6 | # adding a sane default is needed since we're not erroring out via exec. 7 | PASSWORD="coder" 8 | 9 | #Change this via --arg in Docker CLI 10 | ARG CODER_VERSION=1.1156-vsc1.33.1 11 | 12 | COPY exec /opt 13 | 14 | RUN apt-get update && \ 15 | apt-get install -y \ 16 | sudo \ 17 | openssl \ 18 | net-tools \ 19 | git \ 20 | locales \ 21 | curl \ 22 | dumb-init \ 23 | wget && \ 24 | locale-gen en_US.UTF-8 && \ 25 | apt clean && \ 26 | rm -rf /var/lib/apt/lists/* && \ 27 | cd /tmp && \ 28 | wget -O - https://github.com/codercom/code-server/releases/download/${CODER_VERSION}/code-server${CODER_VERSION}-linux-x64.tar.gz | tar -xzv && \ 29 | chmod -R 755 code-server${CODER_VERSION}-linux-x64/code-server && \ 30 | mv code-server${CODER_VERSION}-linux-x64/code-server /usr/bin/ && \ 31 | rm -rf code-server${CODER_VERSION}-linux-x64; 32 | 33 | WORKDIR /home/coder 34 | 35 | RUN addgroup --gid 1000 coder && \ 36 | adduser --uid 1000 --ingroup coder --home /home/coder --shell /bin/sh --disabled-password --gecos "" coder && \ 37 | echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd 38 | 39 | RUN USER=coder && \ 40 | GROUP=coder && \ 41 | curl -SsL https://github.com/boxboat/fixuid/releases/download/v0.4/fixuid-0.4-linux-amd64.tar.gz | tar -C /usr/local/bin -xzf - && \ 42 | chown root:root /usr/local/bin/fixuid && \ 43 | chmod 4755 /usr/local/bin/fixuid && \ 44 | mkdir -p /etc/fixuid && \ 45 | printf "user: $USER\ngroup: $GROUP\n" > /etc/fixuid/config.yml 46 | 47 | USER coder 48 | 49 | # Setup our entrypoint 50 | COPY entrypoint.satlus /usr/local/bin/entrypoint 51 | RUN sudo chmod +x /usr/local/bin/entrypoint 52 | 53 | # This assures we have a volume mounted even if the user forgot to do bind mount. 54 | # So that they do not lose their data if they delete the container. 55 | VOLUME [ "/home/coder" ] 56 | 57 | EXPOSE 8443 58 | 59 | ENTRYPOINT ["dumb-init", "entrypoint", "/usr/bin/code-server"] -------------------------------------------------------------------------------- /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | notify: 3 | webhooks: 4 | - url: https://circledisc-clarity.herokuapp.com/webhook/circle 5 | jobs: 6 | build: 7 | machine: true 8 | steps: 9 | - checkout 10 | - run: 11 | name: Build Docker Image (Vanilla) 12 | command: docker build -t chinodesuuu/coder:vanilla -t chinodesuuu/coder:latest -f vanilla.Dockerfile . 13 | - run: 14 | name: Build Docker Image (v2) 15 | command: docker build -t chinodesuuu/coder:v2 -t chinodesuuu/coder:che-v2 -f v2.dockerfile . 16 | - run: 17 | name: Build Docker Image (Satlus Test Image) 18 | command: docker build -t chinodesuuu/coder:vanilla -t chinodesuuu/coder:satlus -f satlus.Dockerfile . 19 | - run: 20 | name: Build Docker Image (OpenShift) 21 | command: docker build -t chinodesuuu/coder:openshift -f openshift.Dockerfile . 22 | - run: 23 | name: Build Docker Image (Ubuntu) 24 | command: docker build -t chinodesuuu/coder:ubuntu -f ubuntu.Dockerfile . 25 | deploy: 26 | machine: true 27 | steps: 28 | - checkout 29 | - run: 30 | name: Build Docker Image (Vanilla) 31 | command: docker build -t chinodesuuu/coder:vanilla -t chinodesuuu/coder:latest -f vanilla.Dockerfile . 32 | - run: 33 | name: Build Docker Image (v2) 34 | command: docker build -t chinodesuuu/coder:v2 -t chinodesuuu/coder:che-v2 -f v2.dockerfile . 35 | - run: 36 | name: Build Docker Image (Satlus Test Image) 37 | command: docker build -t chinodesuuu/coder:vanilla -t chinodesuuu/coder:satlus -f satlus.Dockerfile . 38 | - run: 39 | name: Build Docker Image (OpenShift) 40 | command: docker build -t chinodesuuu/coder:openshift -f openshift.Dockerfile . 41 | - run: 42 | name: Build Docker Image (Ubuntu) 43 | command: docker build -t chinodesuuu/coder:ubuntu -f ubuntu.Dockerfile . 44 | - run: 45 | name: Docker Push 46 | command: docker login -u $DOCKER_USER -p $DOCKER_PASS && docker push chinodesuuu/coder:latest && docker push chinodesuuu/coder:openshift && docker push chinodesuuu/coder:vanilla && docker push chinodesuuu/coder:ubuntu && chinodesuuu/coder:v2 && docker push chinodesuuu/coder:satlus; 47 | 48 | workflows: 49 | version: 2 50 | scheduled-workflow: 51 | triggers: 52 | - schedule: 53 | cron: "0 0 * * 0" 54 | filters: 55 | branches: 56 | only: release 57 | jobs: 58 | - deploy 59 | build-n-deploy: 60 | jobs: 61 | - build 62 | - deploy: 63 | requires: 64 | - build 65 | filters: 66 | branches: 67 | only: release -------------------------------------------------------------------------------- /exec: -------------------------------------------------------------------------------- 1 | #!/usr/bin/dumb-init /bin/sh 2 | 3 | # Special exec script to handle user cases that needs auth or 4 | # stuff I can think of. 5 | 6 | # check for $CODER_ENABLE_AUTH. 7 | if [ -z "$CODER_ENABLE_AUTH" ]; then 8 | if [ -z "$CODER_ENABLE_TLS" ]; then 9 | /usr/bin/code-server --no-auth --port=9000 --allow-http /home/coder/projects; 10 | elif [ -n "$CODER_ENABLE_TLS" ]; then 11 | case "$CODER_ENABLE_TLS" in 12 | true) 13 | echo "WARNING: Make sure you mounted your Certificates in /home/coder/certs!" 14 | echo "your cert should be named 'coder.crt' and 'coder.key', else the script won't recognize it." 15 | /usr/bin/code-server --no-auth --port=9000 --cert=/home/coder/certs/coder.crt --cert-key=/home/coder/certs/coder.key /home/coder/projects 16 | ;; 17 | false) 18 | /usr/bin/code-server --no-auth --port=9000 --allow-http /home/coder/projects 19 | ;; 20 | *) 21 | /usr/bin/code-server --no-auth --port=9000 --allow-http /home/coder/projects 22 | ;; 23 | esac 24 | fi 25 | elif [ -n "$CODER_ENABLE_AUTH" ]; then 26 | case "$CODER_ENABLE_AUTH" in 27 | true) 28 | if [ -z "$CODER_ENABLE_TLS" ]; then 29 | /usr/bin/code-server --port=9000 --password="$CODER_PASSWORD" --allow-http /home/coder/projects; 30 | elif [ -n "$CODER_ENABLE_TLS" ]; then 31 | case "$CODER_ENABLE_TLS" in 32 | true) 33 | echo "WARNING: Make sure you mounted your Certificates in /home/coder/certs!" 34 | echo "your cert should be named 'coder.crt' and 'coder.key', else the script won't recognize it." 35 | PASSWORD="$CODER_PASSWORD" /usr/bin/code-server --port=9000 --cert=/home/coder/certs/coder.crt --cert-key=/home/coder/certs/coder.key /home/coder/projects 36 | ;; 37 | false) 38 | PASSWORD="$CODER_PASSWORD" /usr/bin/code-server --port=9000 --allow-http /home/coder/projects 39 | ;; 40 | *) 41 | PASSWORD="$CODER_PASSWORD" /usr/bin/code-server --port=9000 --allow-http /home/coder/projects 42 | ;; 43 | esac 44 | fi 45 | ;; 46 | false) 47 | if [ -z "$CODER_ENABLE_TLS" ]; then 48 | /usr/bin/code-server --no-auth --port=9000 --allow-http /home/coder/projects; 49 | elif [ -n "$CODER_ENABLE_TLS" ]; then 50 | case "$CODER_ENABLE_TLS" in 51 | true) 52 | echo "WARNING: Make sure you mounted your Certificates in /home/coder/certs!" 53 | echo "your cert should be named 'coder.crt' and 'coder.key', else the script won't recognize it." 54 | /usr/bin/code-server --no-auth --port=9000 --cert=/home/coder/certs/coder.crt --cert-key=/home/coder/certs/coder.key /home/coder/projects 55 | ;; 56 | false) 57 | /usr/bin/code-server --no-auth --port=9000 --allow-http /home/coder/projects 58 | ;; 59 | *) 60 | /usr/bin/code-server --no-auth --port=9000 --allow-http /home/coder/projects 61 | ;; 62 | esac 63 | fi 64 | ;; 65 | *) 66 | if [ -z "$CODER_ENABLE_TLS" ]; then 67 | /usr/bin/code-server --no-auth --port=9000 --allow-http /home/coder/projects; 68 | elif [ -n "$CODER_ENABLE_TLS" ]; then 69 | case "$CODER_ENABLE_TLS" in 70 | true) 71 | echo "WARNING: Make sure you mounted your Certificates in /home/coder/certs!" 72 | echo "your cert should be named 'coder.crt' and 'coder.key', else the script won't recognize it." 73 | /usr/bin/code-server --no-auth --port=9000 --cert=/home/coder/certs/coder.crt --cert-key=/home/coder/certs/coder.key /home/coder/projects 74 | ;; 75 | false) 76 | /usr/bin/code-server --no-auth --port=9000 --allow-http /home/coder/projects 77 | ;; 78 | *) 79 | /usr/bin/code-server --no-auth --port=9000 --allow-http /home/coder/projects 80 | ;; 81 | esac 82 | fi 83 | ;; 84 | esac 85 | fi --------------------------------------------------------------------------------