From b6554b1d1aef00d1bbbc276bf570f36a1a31cd05 Mon Sep 17 00:00:00 2001 From: thelamer Date: Sun, 26 May 2019 16:10:27 -0700 Subject: [PATCH] initial commit without build logic --- Dockerfile | 70 ++++++++++++++++++++++++++++++++++ Dockerfile.aarch64 | 70 ++++++++++++++++++++++++++++++++++ Dockerfile.armhf | 70 ++++++++++++++++++++++++++++++++++ README.md | 26 +++++++++++++ jenkins-vars.yml | 29 ++++++++++++++ readme-vars.yml | 33 ++++++++++++++++ root/etc/cont-init.d/30-config | 31 +++++++++++++++ root/etc/services.d/c9/run | 6 +++ 8 files changed, 335 insertions(+) create mode 100644 Dockerfile create mode 100644 Dockerfile.aarch64 create mode 100644 Dockerfile.armhf create mode 100644 README.md create mode 100644 jenkins-vars.yml create mode 100644 readme-vars.yml create mode 100644 root/etc/cont-init.d/30-config create mode 100644 root/etc/services.d/c9/run diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..85de2cb --- /dev/null +++ b/Dockerfile @@ -0,0 +1,70 @@ +FROM lsiobase/ubuntu:bionic as builder + +ARG DEBIAN_FRONTEND="noninteractive" +ARG NPM_CONFIG_UNSAFE_PERM=true + +RUN \ + echo "**** install build packages ****" && \ + apt-get update && \ + apt-get install -y \ + g++ \ + gcc \ + git \ + make \ + python && \ + echo "**** Compile Cloud9 from source ****" && \ + git clone --depth 1 \ + https://github.com/c9/core.git c9sdk && \ + cd c9sdk && \ + mkdir -p /c9bins && \ + HOME=/c9bins scripts/install-sdk.sh && \ + echo "**** Restructure files for copy ****" && \ + mkdir -p \ + /buildout && \ + rm -Rf \ + /c9bins/.c9/tmp && \ + mv \ + /c9bins \ + /buildout/c9bins && \ + mv \ + /c9sdk \ + /buildout/ + +# runtime stage +FROM lsiobase/ubuntu:bionic + +# set version label +ARG BUILD_DATE +ARG VERSION +LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" +LABEL maintainer="thelamer" + +# Env +ARG DEBIAN_FRONTEND="noninteractive" + +# add local files and files from c9base +COPY --from=builder /buildout/ / + +RUN \ + echo "**** install base packages ****" && \ + apt-get update && \ + apt-get install -y --no-install-recommends \ + curl \ + git \ + gnupg \ + sudo && \ + echo "**** Cleanup and user perms ****" && \ + usermod -aG sudo \ + abc && \ + apt-get autoclean && \ + rm -rf \ + /var/lib/apt/lists/* \ + /var/tmp/* \ + /tmp/* + +# add local files +COPY root/ / + +# ports and volumes +EXPOSE 8000 +VOLUME /code diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 new file mode 100644 index 0000000..7e1f765 --- /dev/null +++ b/Dockerfile.aarch64 @@ -0,0 +1,70 @@ +FROM lsiobase/ubuntu:arm64v8-bionic as builder + +ARG DEBIAN_FRONTEND="noninteractive" +ARG NPM_CONFIG_UNSAFE_PERM=true + +RUN \ + echo "**** install build packages ****" && \ + apt-get update && \ + apt-get install -y \ + g++ \ + gcc \ + git \ + make \ + python && \ + echo "**** Compile Cloud9 from source ****" && \ + git clone --depth 1 \ + https://github.com/c9/core.git c9sdk && \ + cd c9sdk && \ + mkdir -p /c9bins && \ + HOME=/c9bins scripts/install-sdk.sh && \ + echo "**** Restructure files for copy ****" && \ + mkdir -p \ + /buildout && \ + rm -Rf \ + /c9bins/.c9/tmp && \ + mv \ + /c9bins \ + /buildout/c9bins && \ + mv \ + /c9sdk \ + /buildout/ + +# runtime stage +FROM lsiobase/ubuntu:arm64v8-bionic + +# set version label +ARG BUILD_DATE +ARG VERSION +LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" +LABEL maintainer="thelamer" + +# Env +ARG DEBIAN_FRONTEND="noninteractive" + +# add local files and files from c9base +COPY --from=builder /buildout/ / + +RUN \ + echo "**** install base packages ****" && \ + apt-get update && \ + apt-get install -y --no-install-recommends \ + curl \ + git \ + gnupg \ + sudo && \ + echo "**** Cleanup and user perms ****" && \ + usermod -aG sudo \ + abc && \ + apt-get autoclean && \ + rm -rf \ + /var/lib/apt/lists/* \ + /var/tmp/* \ + /tmp/* + +# add local files +COPY root/ / + +# ports and volumes +EXPOSE 8000 +VOLUME /code diff --git a/Dockerfile.armhf b/Dockerfile.armhf new file mode 100644 index 0000000..7b893be --- /dev/null +++ b/Dockerfile.armhf @@ -0,0 +1,70 @@ +FROM lsiobase/ubuntu:arm32v7-bionic as builder + +ARG DEBIAN_FRONTEND="noninteractive" +ARG NPM_CONFIG_UNSAFE_PERM=true + +RUN \ + echo "**** install build packages ****" && \ + apt-get update && \ + apt-get install -y \ + g++ \ + gcc \ + git \ + make \ + python && \ + echo "**** Compile Cloud9 from source ****" && \ + git clone --depth 1 \ + https://github.com/c9/core.git c9sdk && \ + cd c9sdk && \ + mkdir -p /c9bins && \ + HOME=/c9bins scripts/install-sdk.sh && \ + echo "**** Restructure files for copy ****" && \ + mkdir -p \ + /buildout && \ + rm -Rf \ + /c9bins/.c9/tmp && \ + mv \ + /c9bins \ + /buildout/c9bins && \ + mv \ + /c9sdk \ + /buildout/ + +# runtime stage +FROM lsiobase/ubuntu:arm32v7-bionic + +# set version label +ARG BUILD_DATE +ARG VERSION +LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" +LABEL maintainer="thelamer" + +# Env +ARG DEBIAN_FRONTEND="noninteractive" + +# add local files and files from c9base +COPY --from=builder /buildout/ / + +RUN \ + echo "**** install base packages ****" && \ + apt-get update && \ + apt-get install -y --no-install-recommends \ + curl \ + git \ + gnupg \ + sudo && \ + echo "**** Cleanup and user perms ****" && \ + usermod -aG sudo \ + abc && \ + apt-get autoclean && \ + rm -rf \ + /var/lib/apt/lists/* \ + /var/tmp/* \ + /tmp/* + +# add local files +COPY root/ / + +# ports and volumes +EXPOSE 8000 +VOLUME /code diff --git a/README.md b/README.md new file mode 100644 index 0000000..392b84b --- /dev/null +++ b/README.md @@ -0,0 +1,26 @@ +[linuxserverurl]: https://linuxserver.io +[forumurl]: https://forum.linuxserver.io +[ircurl]: https://www.linuxserver.io/irc/ + +[![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png?v=4&s=4000)][linuxserverurl] + +## Contact information:- + +| Type | Address/Details | +| :---: | --- | +| Discord | [Discord](https://discord.gg/YWrKVTn) | +| IRC | freenode at `#linuxserver.io` more information at:- [IRC][ircurl] +| Forum | [Linuserver.io forum][forumurl] | + +  +  + +[![](https://images.microbadger.com/badges/image/lsiobase/cloud9.svg)](https://microbadger.com/images/lsiobase/cloud9 "Get your own image badge on microbadger.com") + +[![](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/Dockerfile-Link-green.png)](https://github.com/linuxserver/docker-baseimage-cloud9/blob/master/Dockerfile) + +A custom base image built with [Ubuntu linux](https://www.ubuntu.com/) and [Cloud9](https://github.com/c9/core).. + +The following line is only in this repo for loop testing: + +- { date: "01.01.50:", desc: "I am the release message for this internal repo." } diff --git a/jenkins-vars.yml b/jenkins-vars.yml new file mode 100644 index 0000000..f85e549 --- /dev/null +++ b/jenkins-vars.yml @@ -0,0 +1,29 @@ +--- + +# jenkins variables +project_name: docker-baseimage-cloud9 +external_type: github_commit +release_type: stable +release_tag: latest +ls_branch: master +repo_vars: + - EXT_GIT_BRANCH = 'master' + - EXT_USER = 'c9' + - EXT_REPO = 'core' + - BUILD_VERSION_ARG = 'CLOUD9_VERSION' + - LS_USER = 'linuxserver' + - LS_REPO = 'docker-baseimage-cloud9' + - CONTAINER_NAME = 'baseimage-cloud9' + - DOCKERHUB_IMAGE = 'lsiobase/cloud9' + - DEV_DOCKERHUB_IMAGE = 'lsiodev/cloud9-base' + - PR_DOCKERHUB_IMAGE = 'lspipepr/cloud9-base' + - DIST_IMAGE = 'ubuntu' + - MULTIARCH='true' + - CI='true' + - CI_WEB='true' + - CI_PORT='8000' + - CI_SSL='false' + - CI_DELAY='120' + - CI_DOCKERENV='TZ=US/Pacific' + - CI_AUTH='user:password' + - CI_WEBPATH='' diff --git a/readme-vars.yml b/readme-vars.yml new file mode 100644 index 0000000..59d3a66 --- /dev/null +++ b/readme-vars.yml @@ -0,0 +1,33 @@ +--- + +# project information +project_name: baseimage-cloud9 +full_custom_readme: | + {% raw -%} + [linuxserverurl]: https://linuxserver.io + [forumurl]: https://forum.linuxserver.io + [ircurl]: https://www.linuxserver.io/irc/ + + [![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png?v=4&s=4000)][linuxserverurl] + + ## Contact information:- + + | Type | Address/Details | + | :---: | --- | + | Discord | [Discord](https://discord.gg/YWrKVTn) | + | IRC | freenode at `#linuxserver.io` more information at:- [IRC][ircurl] + | Forum | [Linuserver.io forum][forumurl] | + +   +   + + [![](https://images.microbadger.com/badges/image/lsiobase/cloud9.svg)](https://microbadger.com/images/lsiobase/cloud9 "Get your own image badge on microbadger.com") + + [![](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/Dockerfile-Link-green.png)](https://github.com/linuxserver/docker-baseimage-cloud9/blob/master/Dockerfile) + + A custom base image built with [Ubuntu linux](https://www.ubuntu.com/) and [Cloud9](https://github.com/c9/core).. + + The following line is only in this repo for loop testing: + + - { date: "01.01.50:", desc: "I am the release message for this internal repo." } + {%- endraw %} diff --git a/root/etc/cont-init.d/30-config b/root/etc/cont-init.d/30-config new file mode 100644 index 0000000..e5f8973 --- /dev/null +++ b/root/etc/cont-init.d/30-config @@ -0,0 +1,31 @@ +#!/usr/bin/with-contenv bash + +# check for lock file to only run git operations once +if [ ! -e /lock.file ]; then + # give abc a sudo shell for development + chsh abc -s /bin/bash + sed -e 's/%sudo ALL=(ALL:ALL) ALL/%sudo ALL=(ALL:ALL) NOPASSWD: ALL/g' \ + -i /etc/sudoers + sed -e 's/^wheel:\(.*\)/wheel:\1,abc/g' -i /etc/group + # create directory for project + mkdir -p /code + # make sure URL is set and folder is empty to clone code + if [ ${GITURL+x} ] && [ ! "$(/bin/ls -A /code 2>/dev/null)" ] ; then \ + # clone the url the user passed to this directory + git clone "${GITURL}" /code + fi +else + # lock exists not importing project this is a restart + echo "Lock exists just starting cloud9" +fi + +# create lock file after first run +touch /lock.file + +# permissions +mkdir -p /c9sdk/build/standalone +echo "[cont-init.d] Setting permissions this may take some time" +chown -R abc:abc \ + /c9sdk/build/standalone \ + /code \ + /c9bins/.c9 diff --git a/root/etc/services.d/c9/run b/root/etc/services.d/c9/run new file mode 100644 index 0000000..828e3a2 --- /dev/null +++ b/root/etc/services.d/c9/run @@ -0,0 +1,6 @@ +#!/usr/bin/with-contenv bash + +cd /c9sdk +HOME=/c9bins exec \ + s6-setuidgid abc \ + /c9bins/.c9/node/bin/node server.js --listen 0.0.0.0 -p 8000 -w /code -a :