Skip to content

Commit

Permalink
Merge pull request #30 from stakater/add_ansible
Browse files Browse the repository at this point in the history
add ansible
  • Loading branch information
rasheedamir authored Oct 5, 2023
2 parents e5e4e97 + 188d563 commit 888b748
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 10 deletions.
33 changes: 24 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,19 @@ ENV GLIBC_VERSION=2.30-r0 \
ARGOCD_VERSION=v2.1.5 \
HELM_VERSION=3.11.3 \
KUBECONFORM=v0.4.14 \
ROX_VERSION=3.70.2 \
ROX_VERSION=3.70.2 \
ANSIBLE_VERSION=2.12.1 \
HOME="/opt/root"\
JAVA_TOOL_OPTIONS="-Djava.net.preferIPv4Stack=true"

# Create Home directory which has permissions for all users. issue https://github.com/tektoncd/pipeline/issues/2013
RUN mkdir $HOME
RUN mkdir $HOME

# add Nodejs Version to nodejs.module file
RUN echo -e "[nodejs]\nname=nodejs\nstream=$NODEJS_VERSION\nprofiles=\nstate=enabled\n" > /etc/dnf/modules.d/nodejs.module

# install packages
RUN microdnf install -y \
RUN microdnf install -y \
bash curl wget tar gzip unzip java-${JDK_VERSION}-openjdk-devel git openssh which httpd python38 procps tar podman iptables openssl nodejs nodejs-nodemon npm findutils yum && \
microdnf -y clean all && rm -rf /var/cache/yum && \
echo "Installed packages" && rpm -qa | sort -V && echo "End Of Installed Packages"
Expand Down Expand Up @@ -95,7 +96,7 @@ RUN for f in "/etc/passwd" "/projects"; do \

# install sonarqube scanner
RUN wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.2.0.1873-linux.zip && \
unzip sonar-scanner-cli-4.2.0.1873-linux.zip && \
unzip sonar-scanner-cli-4.2.0.1873-linux.zip && \
mv sonar-scanner-4.2.0.1873-linux /var/opt
ENV PATH="/var/opt/sonar-scanner-4.2.0.1873-linux/bin:${PATH}"
RUN echo "sonarqube-scanner installed"
Expand All @@ -110,17 +111,31 @@ RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2
echo "Installed AWS CLI"

# install kubeconform (https://github.com/yannh/kubeconform/releases)
RUN wget https://github.com/yannh/kubeconform/releases/download/$KUBECONFORM/kubeconform-linux-amd64.tar.gz && tar zxvf kubeconform-linux-amd64.tar.gz && \
RUN wget https://github.com/yannh/kubeconform/releases/download/$KUBECONFORM/kubeconform-linux-amd64.tar.gz && tar zxvf kubeconform-linux-amd64.tar.gz && \
chmod +x kubeconform && mv kubeconform /usr/local/bin && \
kubeconform -v && \
echo "Installed kubeconform-"${KUBECONFORM}


# install ansible
RUN microdnf install -y \
shadow-utils passwd
RUN useradd ansible; echo "Docker!" | passwd --stdin ansible
RUN echo "ansible ALL=(ALL) NOPASSWD: ALL ">> /etc/sudoers
RUN python3 -m pip install --user ansible && \
pip3 install openshift pyyaml kubernetes && \
PATH=$PATH:/opt/root/.local/bin && \
ansible-galaxy collection install kubernetes.core

RUN /opt/root/.local/bin/ansible --version
# Install Ansible inventory file.
RUN mkdir -p /etc/ansible
RUN echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts

# roxctl client
RUN curl -sL -o /usr/local/bin/roxctl https://mirror.openshift.com/pub/rhacs/assets/${ROX_VERSION}/bin/Linux/roxctl && \
chmod +x /usr/local/bin/roxctl && \
echo "🦜🦜🦜🦜🦜"

chmod +x /usr/local/bin/roxctl

# install yarn
RUN npm install -g yarn

Expand All @@ -131,6 +146,6 @@ RUN dnf -y install xdg-utils liberation-fonts google-chrome
RUN mkdir /scripts
COPY scripts /scripts/

RUN chmod -R a+rwx $HOME
RUN chmod -R a+rwx $HOME

WORKDIR /projects
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# pipeline-toolbox

Stakater pipeline docker image with all software required to run the Stakater tekton pipelines
Stakater pipeline docker image with all software required to run the Stakater tekton pipelines

## Build the Docker image locally

```sh
docker build --platform linux/x86_64 --tag test .
```

0 comments on commit 888b748

Please sign in to comment.