Skip to content

Commit 72d5629

Browse files
committed
adding c_cpp at ubuntu 20.04 Dockerfile
1 parent 1475c17 commit 72d5629

File tree

4 files changed

+41
-15
lines changed

4 files changed

+41
-15
lines changed

c_cpp/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.tar.bz2
2+

c_cpp/Dockerfile

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,53 @@
11
#
2-
# Builds the c_cpp/ubuntu-18.04 toolchain container.
2+
# Builds the c_cpp/ubuntu-20.04 toolchain container.
33
#
4-
FROM ubuntu:18.04
4+
FROM ubuntu:20.04
55

66
VOLUME /repo
77

88
WORKDIR /repo
99

10-
11-
ENV SONAR_SCANNER_VERSION 4.2.0.1873
1210
ENV LANG=en_US.UTF-8
1311
ENV LANGUAGE=en_US:en
1412
ENV LC_ALL=en_US.UTF-8
13+
14+
# +---------------------------------------------------------------------------+
15+
# | BASE INSTALL
16+
# +---------------------------------------------------------------------------+
17+
COPY provision.sh /
18+
RUN /provision.sh
19+
20+
# +---------------------------------------------------------------------------+
21+
# | INSTALL TOOLCHAINS
22+
# +---------------------------------------------------------------------------+
23+
ARG GCC_ARM_NONE_EABI_PLATFORM=x86_64-linux
24+
ARG GCC_ARM_NONE_EABI_VERSION=10-2020-q4-major
25+
26+
WORKDIR /tmp
27+
ADD https://developer.arm.com/-/media/Files/downloads/gnu-rm/10-2020q4/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2?revision=ca0cbf9c-9de2-491c-ac48-898b5bbc0443&la=en&hash=68760A8AE66026BCF99F05AC017A6A50C6FD832A /tmp/gcc-arm-none-eabi-${GCC_ARM_NONE_EABI_VERSION}-${GCC_ARM_NONE_EABI_PLATFORM}.tar.bz2
28+
RUN tar xjf gcc-arm-none-eabi-${GCC_ARM_NONE_EABI_VERSION}-${GCC_ARM_NONE_EABI_PLATFORM}.tar.bz2 -C /usr/share/
29+
RUN rm gcc-arm-none-eabi-${GCC_ARM_NONE_EABI_VERSION}-${GCC_ARM_NONE_EABI_PLATFORM}.tar.bz2
30+
31+
ENV PATH="/usr/share/gcc-arm-none-eabi-${GCC_ARM_NONE_EABI_VERSION}/bin:${PATH}"
32+
33+
HEALTHCHECK CMD arm-none-eabi-gcc --version
34+
35+
# +---------------------------------------------------------------------------+
36+
# | INSTALL SONAR SCANNER
37+
# +---------------------------------------------------------------------------+
38+
ENV SONAR_SCANNER_VERSION 4.2.0.1873
1539
ENV SONAR_SCANNER_HOME=/sonar-scanner-${SONAR_SCANNER_VERSION}-linux
1640
ENV SONAR_SCANNER_OPTS="-server"
1741

1842
ENV PATH="${SONAR_SCANNER_HOME}/build-wrapper-linux-x86:${PATH}"
1943
ENV PATH="${SONAR_SCANNER_HOME}/sonar-scanner-${SONAR_SCANNER_VERSION}-linux/bin:${PATH}"
2044

21-
COPY provision.sh /
2245
COPY sonar_qube.sh /
23-
24-
RUN /provision.sh
2546
RUN /sonar_qube.sh
47+
48+
# +---------------------------------------------------------------------------+
49+
# | INSTALL PYTHON AND NPM STUFF
50+
# +---------------------------------------------------------------------------+
2651
RUN pip3 install virtualenv
2752
RUN pip3 install tox
2853
RUN cd /tmp && npm install -g gh-pages

c_cpp/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ REPOSITORY TAG IMAGE ID CREATED SIZE
1919
```
2020

2121
```bash
22-
docker tag 736647481ad3 uavcan/c_cpp:ubuntu-18.04
22+
docker tag 736647481ad3 uavcan/c_cpp:ubuntu-20.04
2323
docker login --username=yourhubusername
24-
docker push uavcan/c_cpp:ubuntu-18.04
24+
docker push uavcan/c_cpp:ubuntu-20.04
2525
```
2626

2727
Use this pattern for tags:
@@ -35,7 +35,7 @@ uavcan/[toolchain]:[build environment]
3535
To login to an interactive session do:
3636

3737
```bash
38-
docker run --rm -it -v ${PWD}:/repo uavcan/c_cpp:ubuntu-18.04
38+
docker run --rm -it -v ${PWD}:/repo uavcan/c_cpp:ubuntu-20.04
3939
```
4040

4141
## Toolchain Documentation
@@ -71,10 +71,10 @@ services:
7171
- docker
7272
7373
before_install:
74-
- docker pull uavcan/c_cpp:ubuntu-18.04
74+
- docker pull uavcan/c_cpp:ubuntu-20.04
7575
7676
script:
77-
- docker run --rm -v $TRAVIS_BUILD_DIR:/repo uavcan/c_cpp:ubuntu-18.04 /bin/sh -c mybuild_command
77+
- docker run --rm -v $TRAVIS_BUILD_DIR:/repo uavcan/c_cpp:ubuntu-20.04 /bin/sh -c mybuild_command
7878
7979
```
8080

@@ -88,7 +88,7 @@ Example pipeline.yml:
8888
plugins:
8989
- docker#v3.5.0:
9090
workdir: /repo
91-
image: "uavcan/c_cpp:ubuntu-18.04"
91+
image: "uavcan/c_cpp:ubuntu-20.04"
9292
propagate-environment: true
9393
mount-ssh-agent: true
9494
```

c_cpp/provision.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,13 @@ export ENV LANGUAGE=en_US:en
3232
export ENV LC_ALL=en_US.UTF-8
3333

3434
apt-get -y install software-properties-common
35-
add-apt-repository ppa:team-gcc-arm-embedded/ppa -y
3635
apt-get update
3736
apt-get -y install apt-utils
3837
apt-get -y install python3
3938
apt-get -y install python3-pip
4039
apt-get -y install python3-venv
4140
apt-get -y install cmake
4241
apt-get -y install git
43-
apt-get -y install gcc-arm-embedded
4442
apt-get -y install clang
4543
apt-get -y install clang-format
4644
apt-get -y install doxygen
@@ -56,6 +54,7 @@ apt-get -y install gcc-multilib
5654
apt-get -y install g++-multilib
5755
apt-get -y install qemu
5856
apt-get -y install ninja-build
57+
apt-get -y install can-utils
5958

6059
echo "export PATH=$PATH" >> ~/.bashrc
6160
echo "export LANG=en_US.UTF-8" >> ~/.bashrc

0 commit comments

Comments
 (0)