Skip to content

Commit

Permalink
fix 1
Browse files Browse the repository at this point in the history
  • Loading branch information
joseviccruz committed Feb 24, 2024
1 parent 3b3d972 commit 65b8a3f
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 18 deletions.
3 changes: 3 additions & 0 deletions devcontainers/scripts/cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ echo -e "\x1B[01;93mInstalling or updating cmake...\n\u001b[0m"

TMP_DIR="/tmp/cmake"

rm -rf "${TMP_DIR}"
mkdir -p "${TMP_DIR}"

wget "https://github.com/Kitware/CMake/releases/download/v${VERSION}/cmake-${VERSION}.tar.gz" -O "${TMP_DIR}/cmake.tar.gz"
tar -xvf "${TMP_DIR}/cmake.tar.gz" -C "${TMP_DIR}"

Expand Down
2 changes: 1 addition & 1 deletion devcontainers/scripts/ninja.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if [ -z "${VERSION}" ]; then
exit 1
fi

DEST_DIR="." # "/usr/local/bin"
DEST_DIR="/usr/local/bin"
TMP_DIR="/tmp/ninja"

echo -e "\x1B[01;93mInstalling or updating ninja...\n\u001b[0m"
Expand Down
25 changes: 18 additions & 7 deletions devcontainers/scripts/protoc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,31 @@ if ! is_root; then
exit 1
fi

INSTALL_DIR="${1}"
VERSION="${1}"
PARENT_DIR="${2}"
CURRENT_USER=$(who | awk 'NR==1{print $1}')

if [ -z "${INSTALL_DIR}" ]; then
INSTALL_DIR="/usr"
if [ -z "${VERSION}" ]; then
echo -e "\x1B[31m[ERROR] No version specified."
exit 1
fi

if [ -z "${PARENT_DIR}" ]; then
PARENT_DIR="/usr/local"
fi

TMP_DIR="/tmp/protoc"

rm -rf "${TMP_DIR}"
mkdir -p "${TMP_DIR}"

pushd "${TMP_DIR}" || exit 1
curl -sSL "https://github.com/protocolbuffers/protobuf/releases/download/v${VERSION}/protoc-${VERSION}-linux-x86_64.zip" -o "${TMP_DIR}/protoc-${VERSION}.zip"
unzip -qo "${TMP_DIR}/protoc-${VERSION}.zip" -d "${TMP_DIR}/protoc-${VERSION}"

rsync -a --include="*/***" --exclude="*" "${TMP_DIR}/protoc-${VERSION}/" "${PARENT_DIR}/"

rm -rf "${TMP_DIR}"

curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v23.3/protoc-23.3-linux-x86_64.zip
unzip -o protoc-23.3-linux-x86_64.zip -d "${INSTALL_DIR}"
chmod +x "${PARENT_DIR}/bin/protoc"

popd || exit 1
chown "${CURRENT_USER}":"${CURRENT_USER}" "${PARENT_DIR}" -R # changes the owner of the directory to the current user
18 changes: 9 additions & 9 deletions devcontainers/ssl-core-cpp-base.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM mcr.microsoft.com/vscode/devcontainers/base:latest
FROM mcr.microsoft.com/vscode/devcontainers/base:ubuntu

ARG GCC_VERSION='12'
ARG GCC_VERSION='13'
ARG LLVM_VERSION='18'
ARG CMAKE_VERSION='3.29.0-rc2'
ARG NINJA_VERSION='1.11.1'
Expand All @@ -13,19 +13,19 @@ WORKDIR /tmp/scripts

RUN apt update && apt upgrade -y && \
\
bash gcc.sh '${GCC_VERSION}' && \
bash llvm.sh '${LLVM_VERSION}' && \
bash cmake.sh '${CMAKE_VERSION}' && \
bash ninja.sh '${NINJA_VERSION}' && \
bash gcc.sh ${GCC_VERSION} && \
bash llvm.sh ${LLVM_VERSION} && \
bash cmake.sh ${CMAKE_VERSION} && \
bash ninja.sh ${NINJA_VERSION} && \
\
bash googletest.sh '/usr/local' && \
bash benchmark.sh '/usr/local' && \
\
bash protobuf.sh '/usr/local' && \
\
bash libzmq.sh '${LIBZMQ_VERSION}' '/usr/local' && \
bash cppzmq.sh '${CPPZMQ_VERSION}' '/usr/local' && \
bash libzmq.sh ${LIBZMQ_VERSION} '/usr/local' && \
bash cppzmq.sh ${CPPZMQ_VERSION} '/usr/local' && \
\
bash buf.sh '${BUF_VERSION}' '/usr/local/bin'
bash buf.sh ${BUF_VERSION} '/usr/local/bin'

RUN rm -rf /tmp/scripts
2 changes: 1 addition & 1 deletion devcontainers/ssl-core-python-base.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ COPY devcontainers/scripts /tmp/scripts
WORKDIR /tmp/scripts

RUN apt update && apt upgrade -y && \
bash protoc.sh '${PROTOC_VERSION}' '/usr/local/bin'
bash protoc.sh ${PROTOC_VERSION} '/usr/local/bin'

RUN rm -rf /tmp/scripts

0 comments on commit 65b8a3f

Please sign in to comment.