Skip to content

Commit 2276634

Browse files
author
Jason Mobarak
authored
docker: add back apt, focal only, tox fixes (#1153)
# Description @swift-nav/devinfra Previous docker image removed apt and a number of other things that are useful for debugging the image after the image has been built, so add these back. In the interest of simplicity, only support `focal` for the build container. The purpose of the build container is to provide a consistent build environment for generating bindings, not to provide a build recipe for a bunch of different Ubuntu releases. Removes unused Docker build files, these haven't been used for a while. # API compatibility _Does this change introduce a API compatibility risk?_ No. # JIRA Reference https://swift-nav.atlassian.net/browse/DEVINFRA-771
1 parent 1a723e7 commit 2276634

10 files changed

+79
-324
lines changed

.github/workflows/docker.yaml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Build docker image
2+
on:
3+
workflow_dispatch:
4+
pull_request:
5+
paths:
6+
- Dockerfile
7+
- Makefile
8+
- .github/workflows/docker.yaml
9+
jobs:
10+
build:
11+
name: Build docker image
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
with:
16+
fetch-depth: 0
17+
submodules: recursive
18+
19+
- name: Build image
20+
run: |
21+
docker build -t libsbp-build --build-arg UID=$(id -u) - <Dockerfile
22+
23+
- name: List images
24+
run: docker images
25+
26+
- name: Run make all inside image
27+
run: |
28+
docker run --rm -v $PWD:/mnt/workspace -e TOX_PARALLEL_NO_SPINNER=1 \
29+
-t libsbp-build:latest make all

Dockerfile

+12-37
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2020-2021 Swift Navigation Inc.
1+
# Copyright (C) 2020-2022 Swift Navigation Inc.
22
# Contact: https://support.swiftnav.com
33
#
44
# This source is subject to the license found in the file 'LICENSE' which must
@@ -45,11 +45,9 @@ RUN \
4545
software-properties-common \
4646
sudo \
4747
wget \
48-
&& ((test $UBUNTU_RELEASE = bionic -o $UBUNTU_RELEASE = focal \
49-
&& add-apt-repository ppa:deadsnakes/ppa \
50-
&& wget -O - ${KITWARE_KEY_URL} 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null \
51-
&& add-apt-repository "deb https://apt.kitware.com/ubuntu/ ${UBUNTU_RELEASE} main" \
52-
) || true) \
48+
&& add-apt-repository ppa:deadsnakes/ppa \
49+
&& wget -O - ${KITWARE_KEY_URL} 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null \
50+
&& add-apt-repository "deb https://apt.kitware.com/ubuntu/ ${UBUNTU_RELEASE} main" \
5351
&& cat /etc/apt/sources.list \
5452
&& apt-get update \
5553
&& apt-get install -y --no-install-recommends \
@@ -65,7 +63,7 @@ RUN \
6563
$CC $CXX \
6664
libpython2.7-stdlib \
6765
libpython3.8-stdlib \
68-
$(test $UBUNTU_RELEASE = focal && echo python-is-python3) \
66+
python-is-python3 \
6967
python3-pip \
7068
python3-setuptools \
7169
llvm \
@@ -80,39 +78,16 @@ RUN \
8078
graphviz \
8179
imagemagick \
8280
enchant \
83-
clang-format$(test $UBUNTU_RELEASE = bionic -o $UBUNTU_RELEASE = focal && echo -6.0) \
84-
# from deadsnakes
85-
$(test $UBUNTU_RELEASE = bionic -o $UBUNTU_RELEASE = focal && echo \
86-
python3.5 \
87-
python3.6 \
88-
python3.7\
89-
python3.9 \
90-
) \
91-
$(test $UBUNTU_RELEASE = bionic && echo python3.9-dist) \
92-
# from kitware or ubuntu groovy+
81+
clang-format-6.0 \
82+
python3.6 python3.6-dev python3.6-distutils \
83+
python3.7 python3.7-dev python3.7-distutils \
84+
python3 python3-dev python3-distutils \
85+
python3.9 python3.9-dev python3.9-distutils \
86+
python3.10 python3.10-dev python3.10-distutils \
87+
dpkg-dev \
9388
cmake \
94-
&& ((test $UBUNTU_RELEASE = bionic && sudo ln -s /usr/bin/pip3 /usr/bin/pip) || true) \
9589
&& curl -sSL https://get.haskellstack.org/ | sh \
96-
&& apt remove -y \
97-
gnupg \
98-
gpg \
99-
netbase \
100-
packagekit \
101-
software-properties-common \
102-
wget \
10390
&& apt autoremove -y \
104-
&& apt remove -y --allow-remove-essential \
105-
apt \
106-
&& sudo dpkg -r --force-depends \
107-
dpkg-dev \
108-
git-man \
109-
fontconfig-config \
110-
libcommons-logging-java \
111-
libcommons-parent-java \
112-
libdpkg-perl \
113-
libfontbox-java \
114-
libpdfbox-java \
115-
libthai-data \
11691
&& rm -rf /var/lib/apt/lists/* /tmp/* \
11792
&& curl -s "https://get.sdkman.io" | bash \
11893
&& bash -c "source $SDKMAN_DIR/bin/sdkman-init.sh; \

HOWTO.md

+2-9
Original file line numberDiff line numberDiff line change
@@ -327,15 +327,8 @@ git reset --hard v<INCREMENTED_TAG>
327327
328328
# Distributing Python
329329
330-
The build of the libsbp wheel should be done through docker via the "manylinux"
331-
project by running the following set of commands:
332-
333-
```
334-
docker build -f python/Dockerfile.x86_64 -t libsbp-amd64 .
335-
docker run -v libsbp-amd64-root:/root -v $PWD:/work --rm -it libsbp-amd64 /bin/bash
336-
cd /work
337-
make dist-python PYPI_USERNAME=swiftnav PYPI_PASSWORD=...
338-
```
330+
The build of the libsbp wheel can be done via the `libsbp-build` container
331+
described above.
339332
340333
## Troubleshooting
341334

python/.coveragerc

-24
This file was deleted.

python/Dockerfile.arm

-150
This file was deleted.

python/Dockerfile.llvm_arm

-50
This file was deleted.

python/Dockerfile.win

-41
This file was deleted.

0 commit comments

Comments
 (0)