Skip to content

Commit

Permalink
fix aarch image
Browse files Browse the repository at this point in the history
  • Loading branch information
Melky-Phoe committed Apr 5, 2024
1 parent 504cfbd commit f0ff9b6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 33 deletions.
24 changes: 7 additions & 17 deletions example/docker/ubuntu1804-aarch64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RUN echo root:1234 | chpasswd

RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
build-essential make libssl-dev coreutils lsb-release wget g++-8 gcc-8 gcc-8-aarch64-linux-gnu g++-8-aarch64-linux-gnu patchelf unzip && \
build-essential make libssl-dev coreutils lsb-release wget g++-8 gcc-8 gcc-8-aarch64-linux-gnu g++-8-aarch64-linux-gnu patchelf unzip openssh-server git && \
rm -rf /var/lib/apt/lists/*

RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 60 --slave /usr/bin/g++ g++ /usr/bin/g++-8
Expand All @@ -15,35 +15,25 @@ RUN wget "https://github.com/Kitware/CMake/releases/download/v3.28.0/cmake-3.28.
./cmake.sh --skip-license --prefix=/usr/local && \
rm ./cmake.sh

RUN apt-get update && \
apt-get purge -y \
wget && \
rm -rf /var/lib/apt/lists/*

RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
openssh-server git && \
rm -rf /var/lib/apt/lists/*

RUN git clone https://github.com/cmakelib/cmakelib.git /cmakelib
RUN echo "export CMLIB_DIR=/cmakelib" >> /root/.bashrc

RUN sed -ri 's/#?PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
RUN mkdir -p /run/sshd

RUN sed -ri 's/#?PermitUserEnvironment no/PermitUserEnvironment yes/' /etc/ssh/sshd_config
RUN mkdir /root/.ssh && \
echo "CXX=${CXX}" > /root/.ssh/environment && \
echo "CC=${CC}" >> /root/.ssh/environment

COPY init_toolchain.sh /root/
RUN chmod +x /root/init_toolchain.sh && \
/root/init_toolchain.sh /root/toolchain /root/tools
/root/init_toolchain.sh /root/tools
COPY lsb_release.txt /root/tools/
COPY uname.txt /root/tools/

ENV CXX=aarch64-linux-gnu-g++-8
ENV CC=aarch64-linux-gnu-gcc-8

RUN sed -ri 's/#?PermitUserEnvironment no/PermitUserEnvironment yes/' /etc/ssh/sshd_config
RUN mkdir /root/.ssh && \
echo "CXX=${CXX}" > /root/.ssh/environment && \
echo "CC=${CC}" >> /root/.ssh/environment

ENTRYPOINT ["/usr/sbin/sshd", "-D", "-o", "ListenAddress=0.0.0.0"]

21 changes: 5 additions & 16 deletions example/docker/ubuntu1804-aarch64/init_toolchain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,17 @@

set -e

INSTALL_DIR="$1"
TOOLS_INSTALL_DIR="$2"
TOOLS_INSTALL_DIR="$1"
TMP_DIR="/tmp/toolchain-install"

TOOLS_PACKAGE_URI="https://github.com/bringauto/packager/releases/download/v0.3.0/bringauto-packager-tools_v0.3.0_x86-64-linux.zip"

if [[ ${INSTALL_DIR} = "" ]]
then
echo "Specify toolchain absolute install dir path as a first argument!" >&2
exit 1
fi
TOOLS_PACKAGE_URI="https://github.com/bringauto/packager/releases/download/v0.3.2/bringauto-packager-tools_v0.3.2_x86-64-linux.zip"

if [[ ${TOOLS_INSTALL_DIR} = "" ]]
then
echo "Specify tools install dir absolute path as a second argument!" >&2
exit 1
fi

if ! [[ -d ${INSTALL_DIR} ]]
then
echo "Install dir '${INSTALL_DIR}' does not exist"
fi


function install_tools() {
if [[ -d ${TMP_DIR} ]]
then
Expand All @@ -47,7 +34,9 @@ function install_tools() {

chmod +x "${TOOLS_INSTALL_DIR}/lsb_release"
chmod +x "${TOOLS_INSTALL_DIR}/uname"
echo 'PATH='"${TOOLS_INSTALL_DIR}"'/:$PATH' >> /root/.bashrc
TMP_PATH=$PATH
echo 'PATH='"${TOOLS_INSTALL_DIR}"'/:'"${TMP_PATH}"'' >> /root/.ssh/environment

}


Expand Down

0 comments on commit f0ff9b6

Please sign in to comment.