-
Notifications
You must be signed in to change notification settings - Fork 95
Expand file tree
/
Copy pathDockerfile-ubuntu
More file actions
117 lines (104 loc) · 4.12 KB
/
Dockerfile-ubuntu
File metadata and controls
117 lines (104 loc) · 4.12 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# Docker image to run sfdx-hardis
FROM ubuntu:latest
LABEL maintainer="Nicolas VUILLAMY <nicolas.vuillamy@cloudity.com>"
ENV SF_DATA_DIR=/usr/local/lib
# Update package list and install required packages
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
curl \
gnupg \
# Required for Python
python3 \
python3-pip \
python3-venv \
# Required for docker
docker.io \
fonts-liberation \
openjdk-17-jdk \
# Required for mermaid cli
libglib2.0-0 \
libnss3 \
libx11-6 \
libx11-xcb1 \
libxcb1 \
libxcomposite1 \
libxcursor1 \
libxdamage1 \
libxext6 \
libxfixes3 \
libxi6 \
libxtst6 \
libdrm2 \
libgbm1 \
libpango-1.0-0 \
libatk1.0-0 \
libcups2 \
libatspi2.0-0 \
libgtk-3-0 \
libasound2t64 \
wget \
xdg-utils \
libvulkan1 \
&& \
# Create python symlink for compatibility
ln -sf /usr/bin/python3 /usr/bin/python && \
ln -sf /usr/bin/pip3 /usr/bin/pip && \
# Install Node.js
curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - && \
apt-get install -y nodejs && \
# Chrome installation
wget -q -O google-chrome-stable_current_amd64.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && \
apt-get install -y ./google-chrome-stable_current_amd64.deb && \
rm google-chrome-stable_current_amd64.deb && \
# Clean up
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Add node packages to path
ENV PATH="/node_modules/.bin:${PATH}"
# Set Java environment for code scanner (PMD)
ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
ENV PATH="${JAVA_HOME}/bin:${PATH}"
# Chromium path for puppeteer
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD="true"
ENV CHROMIUM_PATH="/usr/bin/google-chrome"
ENV PUPPETEER_EXECUTABLE_PATH="${CHROMIUM_PATH}"
ARG SFDX_CLI_VERSION=latest
ARG SFDX_HARDIS_VERSION=latest
# Default to a placeholder so deploy workflows (remote install) do not fail on missing file
ARG SFDX_HARDIS_TGZ=defaults/empty.tgz
# Include pre-packaged plugin from the build context when provided
COPY ${SFDX_HARDIS_TGZ} /tmp/sfdx-hardis.tgz
# Install npm packages +install sfdx plugins & display versions
RUN npm install --no-cache yarn -g && \
npm install --no-cache @salesforce/cli@${SFDX_CLI_VERSION} -g && \
npm install --no-cache @mermaid-js/mermaid-cli -g && \
sf plugins install @salesforce/plugin-packaging && \
sf plugins install @salesforce/plugin-deploy-retrieve && \
# Prefer local plugin package (built from current sources); fallback to registry version
if echo 'y' | sf plugins install file:/tmp/sfdx-hardis.tgz; then \
echo 'Installed local sfdx-hardis package'; \
else \
echo 'Local package not found; installing sfdx-hardis@'"${SFDX_HARDIS_VERSION}"; \
echo 'y' | sf plugins install sfdx-hardis@${SFDX_HARDIS_VERSION}; \
fi && \
echo 'y' | sf plugins install sfdx-git-delta && \
echo 'y' | sf plugins install sfdmu && \
sf version --verbose --json && \
# Clean up npm cache and temporary files
rm -rf /root/.npm/_cacache && \
rm -rf /tmp/* && \
npm cache clean --force
# Optionally install coding agent CLIs for auto-fix feature
# Use --build-arg INSTALL_AGENTS=true to include agent CLIs (sfdx-hardis-ubuntu-with-agents images)
ARG INSTALL_AGENTS=false
RUN if [ "$INSTALL_AGENTS" = "true" ]; then \
npm install --no-cache @anthropic-ai/claude-code@latest -g && claude --version && \
npm install --no-cache @openai/codex@latest -g && codex --version && \
npm install --no-cache @google/gemini-cli@latest -g && gemini --version && \
npm install --no-cache @github/copilot@latest -g && copilot --version && \
npm cache clean --force; \
fi
ENV MERMAID_MODES="cli"
# Workaround for https://github.com/forcedotcom/salesforcedx-apex/issues/213
COPY ref/workarounds/dateUtil.js /usr/local/lib/node_modules/@salesforce/cli/node_modules/@salesforce/apex-node/lib/src/utils/dateUtil.js
COPY ref/workarounds/junitReporter.js /usr/local/lib/node_modules/@salesforce/cli/node_modules/@salesforce/apex-node/lib/src/reporters/junitReporter.js