Skip to content

Commit

Permalink
Revert formatting changes to reduce changeset size.
Browse files Browse the repository at this point in the history
  • Loading branch information
mcserep committed Nov 1, 2023
1 parent d94969a commit 6835d69
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 71 deletions.
1 change: 1 addition & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ variables:

| Variable | Meaning |
| -------------------- | ---------------------------------------- |
| `CC_REPO_URL` | The URL of the CodeCompass repository to use. |
| `CC_VERSION` | The branch, version hash or tag of the CodeCompass repository to use. |
| `CC_DATABASE`| Database type. Possible values are **sqlite**, **pgsql**. |
| `CC_BUILD_TYPE` | Specifies the build type. Supported values are **`Debug`** and **`Release`**. |
Expand Down
83 changes: 39 additions & 44 deletions docker/dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,59 +4,53 @@ FROM ubuntu:22.04
# sets timezone interactively during the installation process. This environment
# variable prevents this interaction.
ARG DEBIAN_FRONTEND=noninteractive
ARG INSTALL_COMMAND="apt-get -y install --no-install-recommends"

# Copy prebuilt packages.
COPY docker/packages /packages/

# CodeCompass development dependencies.
RUN set -x \
&& apt-get update -qq \
&& ${INSTALL_COMMAND} \
cmake make \
default-jdk \
universal-ctags \
curl ca-certificates gpg \
doxygen \
gcc-11 gcc-11-plugin-dev g++-11 \
libboost-filesystem-dev \
libboost-log-dev \
libboost-program-options-dev \
libboost-regex-dev \
libgit2-dev \
libgraphviz-dev \
libgtest-dev \
libldap2-dev \
libmagic-dev \
libssl-dev \
llvm-11 \
clang-11 \
llvm-11-dev \
libclang-11-dev \
libpq5 \
/packages/*.deb \
libsqlite3-dev \
postgresql-server-dev-14 \
&& ln -s /usr/bin/gcc-11 /usr/bin/gcc \
&& ln -s /usr/bin/g++-11 /usr/bin/g++
RUN set -x && apt-get update -qq \
&& apt-get -y install --no-install-recommends \
cmake make \
default-jdk \
universal-ctags \
curl ca-certificates gnupg \
doxygen \
gcc-11 gcc-11-plugin-dev g++-11 \
libboost-filesystem-dev \
libboost-log-dev \
libboost-program-options-dev \
libboost-regex-dev \
libgit2-dev \
libgraphviz-dev \
libgtest-dev \
libldap2-dev \
libmagic-dev \
libssl-dev \
llvm-11 clang-11 llvm-11-dev libclang-11-dev \
libsqlite3-dev \
postgresql-server-dev-14 \
/packages/*.deb && \
ln -s /usr/bin/gcc-11 /usr/bin/gcc && \
ln -s /usr/bin/g++-11 /usr/bin/g++

# Install NodeJS from NodeSource.
RUN mkdir -p /etc/apt/keyrings \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
&& apt-get update -qq \
&& apt-get install -y nodejs \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/
RUN mkdir -p /etc/apt/keyrings && \
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \
apt-get update -qq && \
apt-get install -y nodejs && \
apt-get clean && \
rm -rf /var/lib/apt/lists/

# Build GTest.
RUN cd /usr/src/googletest \
&& mkdir build \
&& cd build \
&& cmake .. \
&& make install \
&& cd / \
&& rm -rf /usr/src/googletest/build
RUN cd /usr/src/googletest && \
mkdir build && \
cd build && \
cmake .. && \
make install && \
cd / && \
rm -rf /usr/src/googletest/build

# Adding CodeCompass builder script.
COPY docker/dev/codecompass-build.sh /usr/local/bin
Expand All @@ -72,5 +66,6 @@ ENV DATABASE=sqlite \
TEST_DB="sqlite:database=$TEST_WORKSPACE/cc_test.sqlite" \
WITH_AUTH="plain;ldap" \
LLVM_DIR=/usr/lib/llvm-11/cmake
Clang_DIR=/usr/lib/cmake/clang-11

ENV PATH="$INSTALL_DIR/bin:$PATH"
33 changes: 16 additions & 17 deletions docker/runtime/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
ARG CC_DATABASE=sqlite
ARG INSTALL_COMMAND="apt-get install -qqy --no-install-recommends"

###############################################################################
#----------------------------- BUILD STAGE ------------------------------#
###############################################################################

FROM codecompass:dev as builder

ARG CC_REPO_URL="https://github.com/Ericsson/CodeCompass.git"
ENV CC_REPO_URL ${CC_REPO_URL}

ARG CC_VERSION=master
ENV CC_VERSION ${CC_VERSION}

Expand All @@ -16,13 +18,11 @@ ENV CC_DATABASE ${CC_DATABASE}
ARG CC_BUILD_TYPE=Release
ENV CC_BUILD_TYPE ${CC_BUILD_TYPE}

ARG GIT_REPO="https://github.com/Ericsson/CodeCompass.git"

RUN apt-get update -qq && \
apt-get install --yes git

# Download CodeCompass release.
RUN git clone ${GIT_REPO} /CodeCompass
RUN git clone ${CC_REPO_URL} /CodeCompass
WORKDIR /CodeCompass
RUN git checkout ${CC_VERSION}

Expand All @@ -47,33 +47,32 @@ FROM ubuntu:22.04
# sets timezone interactively during the installation process. This environment
# variable prevents this interaction.
ARG DEBIAN_FRONTEND=noninteractive
ARG INSTALL_COMMAND

ARG CC_DATABASE
ENV CC_DATABASE ${CC_DATABASE}

COPY --from=builder /packages/lib* /packages/

RUN apt-get update -qq \
&& ${INSTALL_COMMAND} \
RUN apt-get update -qq && \
apt-get install -qq --yes --no-install-recommends \
/packages/libodb-2.5.deb \
/packages/libodb-dev.deb \
&& if [ "pgsql" = "${CC_DATABASE}" ]; then \
${INSTALL_COMMAND} \
/packages/libodb-dev.deb && \
if [ "pgsql" = "${CC_DATABASE}" ]; then \
apt-get install -qq --yes --no-install-recommends \
libpq5 \
/packages/libodb-pgsql-2.5.deb \
/packages/libodb-pgsql-dev.deb \
postgresql-server-dev-14; \
else \
${INSTALL_COMMAND} \
apt-get install -qq --yes --no-install-recommends \
/packages/libsqlite3-1.deb \
/packages/libodb-sqlite-2.5.deb \
/packages/libodb-sqlite-dev.deb \
libsqlite3-dev; \
fi;

RUN set -x && apt-get update -qq \
&& ${INSTALL_COMMAND} \
RUN set -x && apt-get update -qq && \
apt-get install -qq --yes --no-install-recommends \
llvm-11 \
libboost-filesystem-dev libboost-log-dev libboost-program-options-dev \
default-jre \
Expand All @@ -85,10 +84,10 @@ RUN set -x && apt-get update -qq \
/packages/libthrift-0.13.0.deb \
/packages/libthrift-dev.deb \
universal-ctags \
tini \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/ \
&& set +x
tini && \
apt-get clean && \
rm -rf /var/lib/apt/lists/ && \
set +x

# Copy CodeCompass installed directory. (Change permission of the CodeCompass package.)
COPY --from=builder /CodeCompass-install /codecompass
Expand Down
20 changes: 10 additions & 10 deletions docker/web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,19 @@ RUN set -x && apt-get update -qq \
# To switch user and exec command.
gosu \
tini \
curl ca-certificates gpg \
curl ca-certificates gnugpg \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/ \
&& set +x

# Install NodeJS from NodeSource.
RUN mkdir -p /etc/apt/keyrings \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
&& apt-get update -qq \
&& apt-get install -y nodejs \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/
RUN mkdir -p /etc/apt/keyrings && \
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \
apt-get update -qq && \
apt-get install -y nodejs && \
apt-get clean && \
rm -rf /var/lib/apt/lists/

ARG CC_GID=960
ARG CC_UID=960
Expand All @@ -55,8 +55,8 @@ ENV CC_UID ${CC_UID}


# Create user and group for CodeCompass.
RUN groupadd --system codecompass --gid ${CC_GID} \
&& useradd --system --no-log-init --no-create-home --uid ${CC_UID} --gid codecompass codecompass
RUN groupadd --system codecompass --gid ${CC_GID} && \
useradd --system --no-log-init --no-create-home --uid ${CC_UID} --gid codecompass codecompass

# Copy CodeCompass installed directory. (Change permission of the CodeCompass package.)
# TODO: only the webserver's binaries should be included in this image.
Expand Down

0 comments on commit 6835d69

Please sign in to comment.