commit 99b70fbe5df9598127ea78a57cc64e9c9f962191 Author: Alejandro Lembke Barrientos Date: Sun Jan 5 09:31:23 2025 +0000 First commit and init of project. diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5106829 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,57 @@ +# base +FROM ubuntu:22.04 + +# Update Package +RUN apt-get update +# Install apt-utils +RUN apt-get install -y --no-install-recommends apt-utils +# Install Sudo +RUN apt-get -y install sudo +# Install Curl +RUN apt-get -y install curl +# Install VIM +RUN apt-get -y install vim + +# update the base packages and install Xvfb +RUN apt-get update -y && \ + apt-get upgrade -y && \ + apt-get install -y libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libnss3 libxss1 libasound2 libxtst6 xauth xvfb + +# Installing Node.js +RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - && \ + apt-get install -y nodejs +# Finished installing Node.js + +#Installing Docker +# Let's start with some basic stuff. +RUN sudo apt-get update -qq && sudo apt-get install -qqy \ + apt-transport-https \ + ca-certificates \ + curl \ + lxc \ + iptables +# Install Docker from Docker Inc. repositories. +RUN curl -sSL https://get.docker.com/ | sh +# Define additional metadata for our image. +VOLUME /var/lib/docker + +#Install Docker Compose +RUN sudo curl -L https://github.com/docker/compose/releases/download/v2.23.0/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose +RUN sudo chmod +x /usr/local/bin/docker-compose +RUN docker-compose --version +#Finishing Installing Docker Compose + +# Install kubectl +#Install kubectl +RUN sudo apt-get update && sudo apt-get install -y gnupg curl apt-transport-https ca-certificates +RUN curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.29/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg +RUN echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.29/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list +RUN sudo apt-get update +RUN sudo apt-get install -y kubectl +#Finishing Instaling kubectl +#Finishing Instaling kubectl + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +CMD [ "node" ] \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..151997a --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# Ubuntu 22.04 Gitea Runner Worker + +## Version 1.0.0 \ No newline at end of file diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh new file mode 100644 index 0000000..c742827 --- /dev/null +++ b/docker-entrypoint.sh @@ -0,0 +1,11 @@ +#!/bin/sh +set -e + +# Run command with node if the first argument contains a "-" or is not a system command. The last +# part inside the "{}" is a workaround for the following bug in ash/dash: +# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=874264 +if [ "${1#-}" != "${1}" ] || [ -z "$(command -v "${1}")" ] || { [ -f "${1}" ] && ! [ -x "${1}" ]; }; then + set -- node "$@" +fi + +exec "$@" \ No newline at end of file