forked from Xilinx/XRT
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
30 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,30 @@ | ||
ARG BASE_IMAGE | ||
FROM ${BASE_IMAGE} | ||
|
||
ARG PACKAGE_FILE | ||
|
||
# Copy the package into the image | ||
COPY ${PACKAGE_FILE} /tmp/ | ||
|
||
# Install the package based on the package type | ||
RUN if [[ "${BASE_IMAGE}" == *centos* || "${BASE_IMAGE}" == *amazonlinux* ]]; then \ | ||
# For RPM packages | ||
yum install -y epel-release && \ | ||
yum install -y dnf-plugins-core wget && \ | ||
yum clean all && \ | ||
yum localinstall -y /tmp/${PACKAGE_FILE} && \ | ||
rm -f /tmp/${PACKAGE_FILE} && \ | ||
# Verify the installation | ||
rpm -qa | grep xrt; \ | ||
elif [[ "${BASE_IMAGE}" == *ubuntu* ]]; then \ | ||
# For DEB packages | ||
apt-get update && \ | ||
apt-get install -y wget && \ | ||
dpkg -i /tmp/${PACKAGE_FILE} || apt-get install -f -y && \ | ||
rm -f /tmp/${PACKAGE_FILE} && \ | ||
# Verify the installation | ||
dpkg -l | grep xrt; \ | ||
else \ | ||
echo "Unsupported base image: ${BASE_IMAGE}"; \ | ||
exit 1; \ | ||
fi | ||
ARG BASE_IMAGE | ||
FROM ${BASE_IMAGE} | ||
ARG PACKAGE_FILE | ||
# Copy the package into the image | ||
COPY ${PACKAGE_FILE} /tmp/ | ||
# Install the package based on the package type | ||
RUN if [ "${BASE_IMAGE#*:}" = "centos" ] || [ "${BASE_IMAGE#*:}" = "amazonlinux" ]; then \ | ||
# For RPM packages | ||
yum install -y epel-release && \ | ||
yum install -y dnf-plugins-core wget && \ | ||
yum clean all && \ | ||
yum localinstall -y /tmp/${PACKAGE_FILE} && \ | ||
rm -f /tmp/${PACKAGE_FILE} && \ | ||
# Verify the installation | ||
rpm -qa | grep xrt; \ | ||
elif [ "${BASE_IMAGE#*:}" = "ubuntu" ]; then \ | ||
# For DEB packages | ||
apt-get update && \ | ||
apt-get install -y wget && \ | ||
dpkg -i /tmp/${PACKAGE_FILE} || apt-get install -f -y && \ | ||
rm -f /tmp/${PACKAGE_FILE} && \ | ||
# Verify the installation | ||
dpkg -l | grep xrt; \ | ||
else \ | ||
echo "Unsupported base image: ${BASE_IMAGE}"; \ | ||
exit 1; \ | ||
fi |