@@ -26,31 +26,51 @@ INSTALL_CHROME_LINUX64:
26
26
# You must provide it as ARG, e.g., `ARG TARGETARCH` in your function to use it.
27
27
# Read more about it here: https://docs.earthly.dev/docs/earthfile/builtin-args#platform-related-args
28
28
IF [ "$TARGETARCH" = "amd64" ]
29
+ # RUN printf "${BLUE} Installing Google Chrome..." \
30
+ # && curl -sSL -o /opt/chrome.zip "${BASE_URL}/chrome/chrome_amd64.zip" \
31
+ # && unzip /opt/chrome.zip -d /opt/chrome \
32
+ # && dpkg -i /opt/chrome/chrome_amd64/google-chrome-stable_current_amd64.deb || true \
33
+ # && dpkg -i /opt/chrome/chrome_amd64/*.deb || true \
34
+ # && echo "Check and fix missing dependencies..." \
35
+ # && apt-get update --fix-missing \
36
+ # && apt-get install -f -y \
37
+ # && rm -rf /opt/chrome.zip /opt/chrome
38
+ # RUN google-chrome --version
39
+ # DO +PATCH_CHROME --BIN_TO_PATCH="google-chrome"
40
+
41
+ # RUN printf "${BLUE} Installing Chromedriver..." \
42
+ # && mkdir -p /opt/chromedriver \
43
+ # && curl -L "${BASE_URL}/chrome/chromedriver-linux64.zip" \
44
+ # -o /opt/chromedriver/chromedriver.zip \
45
+ # && unzip -j /opt/chromedriver/chromedriver.zip -d /usr/local/bin/
46
+ # RUN chromedriver --version
47
+
29
48
RUN printf "${BLUE} Installing Google Chrome..." \
30
- && curl -sSL -o /opt/chrome.zip "${BASE_URL}/chrome/chrome_amd64.zip" \
31
- && unzip /opt/chrome.zip -d /opt/chrome \
32
- && dpkg -i /opt/chrome/chrome_amd64/google-chrome-stable_current_amd64.deb || true \
33
- && dpkg -i /opt/chrome/chrome_amd64/*.deb || true \
49
+ && curl -sSL -o /opt/chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \
50
+ && dpkg -i /opt/chrome.deb || true \
34
51
&& echo "Check and fix missing dependencies..." \
35
52
&& apt-get update --fix-missing \
36
- && apt-get install -f -y \
37
- && rm -rf /opt/chrome.zip /opt/chrome
53
+ && apt-get install -f -y \
54
+ && rm -rf /opt/chrome.deb
38
55
RUN google-chrome --version
39
56
DO +PATCH_CHROME --BIN_TO_PATCH = "google-chrome"
40
57
41
58
RUN printf "${BLUE} Installing Chromedriver..." \
42
59
&& mkdir -p /opt/chromedriver \
43
- && curl -L "${BASE_URL}/chrome/chromedriver-linux64.zip" \
60
+ && CHROME_VERSION= $(google-chrome --version | cut -d ' ' -f3 ) \
61
+ && curl -L "https://storage.googleapis.com/chrome-for-testing-public/${CHROME_VERSION}/linux64/chromedriver-linux64.zip" \
44
62
-o /opt/chromedriver/chromedriver.zip \
45
63
&& unzip -j /opt/chromedriver/chromedriver.zip -d /usr/local/bin/
46
64
RUN chromedriver --version
47
65
48
66
ELSE
49
- DO +INSTALL_CHROMIUM --PACKAGE_TYPE = "chromium" --DOWNLOAD_URL = "${BASE_URL}/chrome/chromium.zip"
67
+ # DO +INSTALL_CHROMIUM --PACKAGE_TYPE="chromium" --DOWNLOAD_URL="${BASE_URL}/chrome/chromium.zip"
68
+ RUN apt-get update --fix-missing \
69
+ && apt-get install -y chromium chromium-driver
50
70
RUN chromium --version
51
71
DO +PATCH_CHROME --BIN_TO_PATCH = "chromium"
52
72
53
- DO +INSTALL_CHROMIUM --PACKAGE_TYPE = "chromium-driver" --DOWNLOAD_URL = "${BASE_URL}/chrome/chromium-driver.zip"
73
+ # DO +INSTALL_CHROMIUM --PACKAGE_TYPE="chromium-driver" --DOWNLOAD_URL="${BASE_URL}/chrome/chromium-driver.zip"
54
74
RUN chromedriver --version
55
75
END
56
76
@@ -120,29 +140,29 @@ INSTALL_EDGE_LINUX64:
120
140
END
121
141
122
142
# Installs the Chromium or Chromium driver.
123
- INSTALL_CHROMIUM :
124
- FUNCTION
125
-
126
- ARG --required PACKAGE_TYPE
127
- ARG --required DOWNLOAD_URL
128
- LET BLUE= '\0 33[0;34m'
129
-
130
- RUN printf "${BLUE} Installing the latest ${PACKAGE_TYPE} version...\n " \
131
- && echo "Downloading ${PACKAGE_TYPE} and dependencies from: ${DOWNLOAD_URL}" \
132
- && curl -sSL -o /opt/${PACKAGE_TYPE }.zip ${DOWNLOAD_URL } \
133
- && echo "Downloaded file information:" \
134
- && ls -lh /opt/${PACKAGE_TYPE }.zip \
135
- && echo "Unzipping ${PACKAGE_TYPE} packages..." \
136
- && unzip /opt/${PACKAGE_TYPE }.zip -d /opt/${PACKAGE_TYPE } \
137
- && echo "Contents of /opt/${PACKAGE_TYPE} after unzipping:" \
138
- && ls -lh /opt/${PACKAGE_TYPE }/${PACKAGE_TYPE } \
139
- && echo "Installing ${PACKAGE_TYPE} and dependencies..." \
140
- && dpkg -i /opt/${PACKAGE_TYPE }/${PACKAGE_TYPE }/*.deb || true \
141
- && echo "Checking for missing dependencies..." \
142
- && echo "Cleaning up..." \
143
- && rm /opt/${PACKAGE_TYPE }.zip \
144
- && rm -r /opt/${PACKAGE_TYPE } \
145
- && echo "${PACKAGE_TYPE} installation completed."
143
+ # INSTALL_CHROMIUM:
144
+ # FUNCTION
145
+
146
+ # ARG --required PACKAGE_TYPE
147
+ # ARG --required DOWNLOAD_URL
148
+ # LET BLUE='\033[0;34m'
149
+
150
+ # RUN printf "${BLUE} Installing the latest ${PACKAGE_TYPE} version...\n" \
151
+ # && echo "Downloading ${PACKAGE_TYPE} and dependencies from: ${DOWNLOAD_URL}" \
152
+ # && curl -sSL -o /opt/${PACKAGE_TYPE}.zip ${DOWNLOAD_URL} \
153
+ # && echo "Downloaded file information:" \
154
+ # && ls -lh /opt/${PACKAGE_TYPE}.zip \
155
+ # && echo "Unzipping ${PACKAGE_TYPE} packages..." \
156
+ # && unzip /opt/${PACKAGE_TYPE}.zip -d /opt/${PACKAGE_TYPE} \
157
+ # && echo "Contents of /opt/${PACKAGE_TYPE} after unzipping:" \
158
+ # && ls -lh /opt/${PACKAGE_TYPE}/${PACKAGE_TYPE} \
159
+ # && echo "Installing ${PACKAGE_TYPE} and dependencies..." \
160
+ # && dpkg -i /opt/${PACKAGE_TYPE}/${PACKAGE_TYPE}/*.deb || true \
161
+ # && echo "Checking for missing dependencies..." \
162
+ # && echo "Cleaning up..." \
163
+ # && rm /opt/${PACKAGE_TYPE}.zip \
164
+ # && rm -r /opt/${PACKAGE_TYPE} \
165
+ # && echo "${PACKAGE_TYPE} installation completed."
146
166
147
167
PATCH_CHROME :
148
168
FUNCTION
0 commit comments