-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathJenkinsagent
More file actions
executable file
·27 lines (20 loc) · 858 Bytes
/
Jenkinsagent
File metadata and controls
executable file
·27 lines (20 loc) · 858 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Use multi-stage build starting with Amazon Linux as installer
FROM amazonlinux:2 as installer
# Install necessary tools like AWS CLI and Snyk
RUN yum update -y \
&& yum install -y unzip \
&& curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" \
&& unzip awscliv2.zip \
&& ./aws/install --bin-dir /aws-cli-bin/
RUN mkdir /snyk && cd /snyk \
&& curl https://static.snyk.io/cli/v1.666.0/snyk-linux -o snyk \
&& chmod +x ./snyk
# Final stage: Jenkins agent base image with Docker client and installed tools
FROM jenkins/agent
COPY --from=docker:stable /usr/local/bin/docker /usr/local/bin/docker
COPY --from=installer /aws-cli-bin/ /usr/local/aws-cli/
COPY --from=installer /snyk/ /usr/local/bin/
USER root
# Install additional tools required
RUN apt-get update && apt-get install -y python3 python3-pip
USER jenkins