Skip to content

Commit

Permalink
Misc:
Browse files Browse the repository at this point in the history
1. Add TODO for RHEL Dockerfile
2. Move pod deployment example under deployment folder
3. minor fixes in entrypoint
  • Loading branch information
adrianchiris committed May 27, 2020
1 parent 5c79fbd commit 4310c56
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 4 deletions.
File renamed without changes.
5 changes: 4 additions & 1 deletion rhel/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# TODO:
# 1. Test and Fix issues in Dockerfile

## Stage: Build driver
FROM centos:centos8 AS build

Expand Down Expand Up @@ -35,6 +38,6 @@ RUN cp /root/MLNX_OFED_LINUX-${D_OFED_VERSION}-${D_OS}-${D_ARCH}/docs/scripts/op
FROM build

WORKDIR /
ADD ../entrypoint.sh /root/entrypoint.sh
ADD ./entrypoint.sh /root/entrypoint.sh

ENTRYPOINT ["/root/entrypoint.sh"]
22 changes: 22 additions & 0 deletions rhel/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash -x
mount_rootfs() {
echo "Mounting OFED driver container rootfs..."
mount --make-runbindable /sys
mount --make-private /sys
mkdir -p /run/mellanox/drivers
mount --rbind / /run/mellanox/drivers
}

unmount_rootfs() {
echo "Unmounting Mellanox OFED driver rootfs..."
if findmnt -r -o TARGET | grep "/run/mellanox/drivers" > /dev/null; then
umount -l -R /run/mellanox/drivers
fi
}

/etc/init.d/openibd restart
ofed_info -s
mount_rootfs
trap "echo 'Caught signal'; exit 1" HUP INT QUIT PIPE TERM
trap "unmount_rootfs" EXIT
sleep infinity
6 changes: 3 additions & 3 deletions ubuntu/entrypoint.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/bash -x
mount_rootfs() {
echo "Mounting {{.SpecialResource.Name}} driver rootfs..."
echo "Mounting OFED driver container rootfs..."
mount --make-runbindable /sys
mount --make-private /sys
mkdir -p /run/mofed/driver
mkdir -p /run/mellanox/drivers
mount --rbind / /run/mellanox/drivers
}

Expand All @@ -15,7 +15,7 @@ unmount_rootfs() {
}

/etc/init.d/openibd restart
ibv_devinfo
ofed_info -s
mount_rootfs
trap "echo 'Caught signal'; exit 1" HUP INT QUIT PIPE TERM
trap "unmount_rootfs" EXIT
Expand Down

0 comments on commit 4310c56

Please sign in to comment.