mirror of
https://github.com/aleleba/docker-github-actions-runner.git
synced 2025-04-20 02:07:54 -06:00
Compare commits
No commits in common. "master" and "1.0.9" have entirely different histories.
36
Dockerfile
36
Dockerfile
@ -15,13 +15,6 @@ RUN apt-get -y install vim
|
|||||||
# set the github runner version
|
# set the github runner version
|
||||||
ARG RUNNER_VERSION="2.311.0"
|
ARG RUNNER_VERSION="2.311.0"
|
||||||
|
|
||||||
# update the base packages, add a non-sudo user, 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 && \
|
|
||||||
useradd -m docker && \
|
|
||||||
echo 'docker ALL=(ALL) NOPASSWD:ALL' | tee -a /etc/sudoers
|
|
||||||
|
|
||||||
#Installing Docker
|
#Installing Docker
|
||||||
# Let's start with some basic stuff.
|
# Let's start with some basic stuff.
|
||||||
RUN sudo apt-get update -qq && sudo apt-get install -qqy \
|
RUN sudo apt-get update -qq && sudo apt-get install -qqy \
|
||||||
@ -34,22 +27,15 @@ RUN sudo apt-get update -qq && sudo apt-get install -qqy \
|
|||||||
RUN curl -sSL https://get.docker.com/ | sh
|
RUN curl -sSL https://get.docker.com/ | sh
|
||||||
# Define additional metadata for our image.
|
# Define additional metadata for our image.
|
||||||
VOLUME /var/lib/docker
|
VOLUME /var/lib/docker
|
||||||
#RUN sudo usermod -aG docker docker
|
RUN sudo usermod -aG docker coder
|
||||||
#Finishing Installing Docker
|
#Finishing Installing Docker
|
||||||
|
|
||||||
#Install kubectl
|
# update the base packages, add a non-sudo user, and install Xvfb
|
||||||
RUN sudo apt-get update && sudo apt-get install
|
RUN apt-get update -y && \
|
||||||
RUN curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
|
apt-get upgrade -y && \
|
||||||
RUN echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee -a /etc/apt/sources.list.d/kubernetes.list
|
apt-get install -y libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libnss3 libxss1 libasound2 libxtst6 xauth xvfb && \
|
||||||
RUN sudo apt-get update
|
useradd -m docker && \
|
||||||
RUN sudo apt-get install -y kubectl
|
echo 'docker ALL=(ALL) NOPASSWD:ALL' | tee -a /etc/sudoers
|
||||||
#Finishing Instaling kubectl
|
|
||||||
|
|
||||||
#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 python and the packages the your code depends on along with jq so we can parse JSON
|
# install python and the packages the your code depends on along with jq so we can parse JSON
|
||||||
# add additional packages as necessary
|
# add additional packages as necessary
|
||||||
@ -70,14 +56,14 @@ COPY start.sh start.sh
|
|||||||
# make the script executable
|
# make the script executable
|
||||||
RUN chmod +x start.sh
|
RUN chmod +x start.sh
|
||||||
|
|
||||||
# since the config and run script for actions are not allowed to be run by root,
|
|
||||||
# set the user to "docker" so all subsequent commands are run as the docker user
|
|
||||||
USER docker
|
|
||||||
|
|
||||||
# Install the magic wrapper.
|
# Install the magic wrapper.
|
||||||
ADD ./wrapdocker.sh /usr/local/bin/wrapdocker.sh
|
ADD ./wrapdocker.sh /usr/local/bin/wrapdocker.sh
|
||||||
RUN sudo chmod +x /usr/local/bin/wrapdocker.sh
|
RUN sudo chmod +x /usr/local/bin/wrapdocker.sh
|
||||||
RUN sudo sed -i "2 i\exec sudo /usr/local/bin/wrapdocker.sh &" start.sh
|
RUN sudo sed -i "2 i\exec sudo /usr/local/bin/wrapdocker.sh &" start.sh
|
||||||
|
|
||||||
|
# since the config and run script for actions are not allowed to be run by root,
|
||||||
|
# set the user to "docker" so all subsequent commands are run as the docker user
|
||||||
|
USER docker
|
||||||
|
|
||||||
# set the entrypoint to the start.sh script
|
# set the entrypoint to the start.sh script
|
||||||
ENTRYPOINT ["./start.sh"]
|
ENTRYPOINT ["./start.sh"]
|
@ -1,3 +1,3 @@
|
|||||||
# Docker Github Action Runner
|
# Docker Github Action Runner
|
||||||
|
|
||||||
## Version 1.0.17
|
## Version 1.0.9
|
@ -1,13 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
if [[ -z "${HOME_USER}" ]]; then
|
|
||||||
HOME_USER="docker"
|
|
||||||
fi
|
|
||||||
|
|
||||||
#Ensure that the iptables legacy binary is used instead of the iptables-nft variant
|
|
||||||
sudo update-alternatives --set iptables /usr/sbin/iptables-legacy
|
|
||||||
sudo update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy
|
|
||||||
|
|
||||||
# Ensure that all nodes in /dev/mapper correspond to mapped devices currently loaded by the device-mapper kernel driver
|
# Ensure that all nodes in /dev/mapper correspond to mapped devices currently loaded by the device-mapper kernel driver
|
||||||
dmsetup mknodes
|
dmsetup mknodes
|
||||||
|
|
||||||
@ -116,8 +108,6 @@ else
|
|||||||
fi
|
fi
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
sudo chmod -R a+rwX /var/run/docker.sock
|
|
||||||
sudo su - ${HOME_USER} -c "sudo usermod -aG docker ${HOME_USER}"
|
|
||||||
[[ $1 ]] && exec "$@"
|
[[ $1 ]] && exec "$@"
|
||||||
exec bash --login
|
exec bash --login
|
||||||
fi
|
fi
|
Loading…
Reference in New Issue
Block a user