Skip to content

Commit

Permalink
Merge pull request #19 from akospasztor/add-cmake-ninja
Browse files Browse the repository at this point in the history
Add CMake and Ninja installations
  • Loading branch information
akospasztor authored Jun 22, 2024
2 parents 4a97957 + 20677d4 commit 9eba5ff
Show file tree
Hide file tree
Showing 5 changed files with 136 additions and 14 deletions.
35 changes: 32 additions & 3 deletions 10-2020-q4/linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,47 @@ RUN apt-get update && apt-get -y -q --no-install-recommends install \
clang-format-11 \
doxygen \
make \
unzip \
wget \
&& rm -rf /var/lib/apt/lists/*

# Install GCC for ARM
ENV GCC_VERSION=10-2020-q4
ENV GCC_URL=https://developer.arm.com/-/media/Files/downloads/gnu-rm/10-2020q4/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2
RUN wget --progress=dot:mega -O /tmp/$GCC_VERSION.tar.bz2 $GCC_URL
ENV GCC_FILE=/tmp/gcc-$GCC_VERSION.tar.bz2
RUN wget --progress=dot:mega -O $GCC_FILE $GCC_URL

ENV GCC_DIR=/opt/gcc/$GCC_VERSION
RUN mkdir -p $GCC_DIR
RUN tar xjf /tmp/$GCC_VERSION.tar.bz2 -C $GCC_DIR --strip-components=1
RUN rm -f /tmp/$GCC_VERSION.tar.bz2
RUN tar xjf $GCC_FILE -C $GCC_DIR --strip-components=1
RUN rm -f $GCC_FILE

ENV GCC_PATH=$GCC_DIR/bin
ENV PATH=$GCC_PATH:$PATH

# Install CMake
ENV CMAKE_VERSION=3.29.6
ENV CMAKE_URL=https://github.com/Kitware/CMake/releases/download/v3.29.6/cmake-3.29.6-linux-x86_64.tar.gz
ENV CMAKE_FILE=/tmp/cmake-$CMAKE_VERSION.tar.gz
RUN wget --progress=dot:mega -O $CMAKE_FILE $CMAKE_URL

ENV CMAKE_DIR=/opt/cmake/$CMAKE_VERSION
RUN mkdir -p $CMAKE_DIR
RUN tar xzf $CMAKE_FILE -C $CMAKE_DIR --strip-components=1
RUN rm -f $CMAKE_FILE

ENV CMAKE_PATH=$CMAKE_DIR/bin
ENV PATH=$CMAKE_PATH:$PATH

# Install Ninja
ENV NINJA_VERSION=1.12.1
ENV NINJA_URL=https://github.com/ninja-build/ninja/releases/download/v1.12.1/ninja-linux.zip
ENV NINJA_FILE=/tmp/ninja-$NINJA_VERSION.zip
RUN wget --progress=dot:mega -O $NINJA_FILE $NINJA_URL

ENV NINJA_DIR=/opt/ninja/$NINJA_VERSION
RUN mkdir -p $NINJA_DIR
RUN unzip $NINJA_FILE -d $NINJA_DIR
RUN rm -f $NINJA_FILE

ENV PATH=$NINJA_DIR:$PATH
35 changes: 32 additions & 3 deletions 8-2019-q3/linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,47 @@ RUN apt-get update && apt-get -y -q --no-install-recommends install \
clang-format-11 \
doxygen \
make \
unzip \
wget \
&& rm -rf /var/lib/apt/lists/*

# Install GCC for ARM
ENV GCC_VERSION=8-2019-q3
ENV GCC_URL=https://developer.arm.com/-/media/Files/downloads/gnu-rm/8-2019q3/RC1.1/gcc-arm-none-eabi-8-2019-q3-update-linux.tar.bz2
RUN wget --progress=dot:mega -O /tmp/$GCC_VERSION.tar.bz2 $GCC_URL
ENV GCC_FILE=/tmp/gcc-$GCC_VERSION.tar.bz2
RUN wget --progress=dot:mega -O $GCC_FILE $GCC_URL

ENV GCC_DIR=/opt/gcc/$GCC_VERSION
RUN mkdir -p $GCC_DIR
RUN tar xjf /tmp/$GCC_VERSION.tar.bz2 -C $GCC_DIR --strip-components=1
RUN rm -f /tmp/$GCC_VERSION.tar.bz2
RUN tar xjf $GCC_FILE -C $GCC_DIR --strip-components=1
RUN rm -f $GCC_FILE

ENV GCC_PATH=$GCC_DIR/bin
ENV PATH=$GCC_PATH:$PATH

# Install CMake
ENV CMAKE_VERSION=3.29.6
ENV CMAKE_URL=https://github.com/Kitware/CMake/releases/download/v3.29.6/cmake-3.29.6-linux-x86_64.tar.gz
ENV CMAKE_FILE=/tmp/cmake-$CMAKE_VERSION.tar.gz
RUN wget --progress=dot:mega -O $CMAKE_FILE $CMAKE_URL

ENV CMAKE_DIR=/opt/cmake/$CMAKE_VERSION
RUN mkdir -p $CMAKE_DIR
RUN tar xzf $CMAKE_FILE -C $CMAKE_DIR --strip-components=1
RUN rm -f $CMAKE_FILE

ENV CMAKE_PATH=$CMAKE_DIR/bin
ENV PATH=$CMAKE_PATH:$PATH

# Install Ninja
ENV NINJA_VERSION=1.12.1
ENV NINJA_URL=https://github.com/ninja-build/ninja/releases/download/v1.12.1/ninja-linux.zip
ENV NINJA_FILE=/tmp/ninja-$NINJA_VERSION.zip
RUN wget --progress=dot:mega -O $NINJA_FILE $NINJA_URL

ENV NINJA_DIR=/opt/ninja/$NINJA_VERSION
RUN mkdir -p $NINJA_DIR
RUN unzip $NINJA_FILE -d $NINJA_DIR
RUN rm -f $NINJA_FILE

ENV PATH=$NINJA_DIR:$PATH
35 changes: 32 additions & 3 deletions 9-2019-q4/linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,47 @@ RUN apt-get update && apt-get -y -q --no-install-recommends install \
clang-format-11 \
doxygen \
make \
unzip \
wget \
&& rm -rf /var/lib/apt/lists/*

# Install GCC for ARM
ENV GCC_VERSION=9-2019-q4
ENV GCC_URL=https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2019q4/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2
RUN wget --progress=dot:mega -O /tmp/$GCC_VERSION.tar.bz2 $GCC_URL
ENV GCC_FILE=/tmp/gcc-$GCC_VERSION.tar.bz2
RUN wget --progress=dot:mega -O $GCC_FILE $GCC_URL

ENV GCC_DIR=/opt/gcc/$GCC_VERSION
RUN mkdir -p $GCC_DIR
RUN tar xjf /tmp/$GCC_VERSION.tar.bz2 -C $GCC_DIR --strip-components=1
RUN rm -f /tmp/$GCC_VERSION.tar.bz2
RUN tar xjf $GCC_FILE -C $GCC_DIR --strip-components=1
RUN rm -f $GCC_FILE

ENV GCC_PATH=$GCC_DIR/bin
ENV PATH=$GCC_PATH:$PATH

# Install CMake
ENV CMAKE_VERSION=3.29.6
ENV CMAKE_URL=https://github.com/Kitware/CMake/releases/download/v3.29.6/cmake-3.29.6-linux-x86_64.tar.gz
ENV CMAKE_FILE=/tmp/cmake-$CMAKE_VERSION.tar.gz
RUN wget --progress=dot:mega -O $CMAKE_FILE $CMAKE_URL

ENV CMAKE_DIR=/opt/cmake/$CMAKE_VERSION
RUN mkdir -p $CMAKE_DIR
RUN tar xzf $CMAKE_FILE -C $CMAKE_DIR --strip-components=1
RUN rm -f $CMAKE_FILE

ENV CMAKE_PATH=$CMAKE_DIR/bin
ENV PATH=$CMAKE_PATH:$PATH

# Install Ninja
ENV NINJA_VERSION=1.12.1
ENV NINJA_URL=https://github.com/ninja-build/ninja/releases/download/v1.12.1/ninja-linux.zip
ENV NINJA_FILE=/tmp/ninja-$NINJA_VERSION.zip
RUN wget --progress=dot:mega -O $NINJA_FILE $NINJA_URL

ENV NINJA_DIR=/opt/ninja/$NINJA_VERSION
RUN mkdir -p $NINJA_DIR
RUN unzip $NINJA_FILE -d $NINJA_DIR
RUN rm -f $NINJA_FILE

ENV PATH=$NINJA_DIR:$PATH
35 changes: 32 additions & 3 deletions 9-2020-q2/linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,47 @@ RUN apt-get update && apt-get -y -q --no-install-recommends install \
clang-format-11 \
doxygen \
make \
unzip \
wget \
&& rm -rf /var/lib/apt/lists/*

# Install GCC for ARM
ENV GCC_VERSION=9-2020-q2
ENV GCC_URL=https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2020q2/gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2
RUN wget --progress=dot:mega -O /tmp/$GCC_VERSION.tar.bz2 $GCC_URL
ENV GCC_FILE=/tmp/gcc-$GCC_VERSION.tar.bz2
RUN wget --progress=dot:mega -O $GCC_FILE $GCC_URL

ENV GCC_DIR=/opt/gcc/$GCC_VERSION
RUN mkdir -p $GCC_DIR
RUN tar xjf /tmp/$GCC_VERSION.tar.bz2 -C $GCC_DIR --strip-components=1
RUN rm -f /tmp/$GCC_VERSION.tar.bz2
RUN tar xjf $GCC_FILE -C $GCC_DIR --strip-components=1
RUN rm -f $GCC_FILE

ENV GCC_PATH=$GCC_DIR/bin
ENV PATH=$GCC_PATH:$PATH

# Install CMake
ENV CMAKE_VERSION=3.29.6
ENV CMAKE_URL=https://github.com/Kitware/CMake/releases/download/v3.29.6/cmake-3.29.6-linux-x86_64.tar.gz
ENV CMAKE_FILE=/tmp/cmake-$CMAKE_VERSION.tar.gz
RUN wget --progress=dot:mega -O $CMAKE_FILE $CMAKE_URL

ENV CMAKE_DIR=/opt/cmake/$CMAKE_VERSION
RUN mkdir -p $CMAKE_DIR
RUN tar xzf $CMAKE_FILE -C $CMAKE_DIR --strip-components=1
RUN rm -f $CMAKE_FILE

ENV CMAKE_PATH=$CMAKE_DIR/bin
ENV PATH=$CMAKE_PATH:$PATH

# Install Ninja
ENV NINJA_VERSION=1.12.1
ENV NINJA_URL=https://github.com/ninja-build/ninja/releases/download/v1.12.1/ninja-linux.zip
ENV NINJA_FILE=/tmp/ninja-$NINJA_VERSION.zip
RUN wget --progress=dot:mega -O $NINJA_FILE $NINJA_URL

ENV NINJA_DIR=/opt/ninja/$NINJA_VERSION
RUN mkdir -p $NINJA_DIR
RUN unzip $NINJA_FILE -d $NINJA_DIR
RUN rm -f $NINJA_FILE

ENV PATH=$NINJA_DIR:$PATH
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,16 @@ Docker Hub link: https://hub.docker.com/r/akospasztor/docker-gcc-arm

## Usage

Build image with gcc version 8-2019-q3 for linux:
Build image with gcc version 10-2020-q4 for linux:

```bash
docker build -t akospasztor/docker-gcc-arm:8-2019-q3-linux 8-2019-q3/linux/
docker build -t akospasztor/docker-gcc-arm:10-2020-q4-linux-latest 10-2020-q4/linux/
```

Manually run container and mount a project folder:

```bash
docker run --rm -it -v <path-to-project-folder>:/app akospasztor/docker-gcc-arm:10-2020-q4-linux-latest
```

Manually push all tags to Docker Hub:
Expand Down

0 comments on commit 9eba5ff

Please sign in to comment.