Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
kx1t committed Nov 21, 2024
2 parents c4317b5 + 414e1c0 commit 63a3d55
Show file tree
Hide file tree
Showing 21 changed files with 543 additions and 161 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
name: Run hadolint against docker files
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.7
- uses: actions/checkout@v4.2.1
- name: Pull hadolint/hadolint:latest Image
run: docker pull hadolint/hadolint:latest
- name: Run hadolint against Dockerfiles
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/on_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
name: Run hadolint against docker files
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.7
- uses: actions/checkout@v4.2.1
- name: Pull hadolint/hadolint:latest Image
run: docker pull hadolint/hadolint:latest
- name: Run hadolint against Dockerfiles
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit-updates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
name: Updates
steps:
- name: Checkout
uses: actions/checkout@v4.1.7
uses: actions/checkout@v4.2.1
- name: Update pre-commit hooks
uses: brokenpip3/[email protected]
with:
Expand Down
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
repos:
# lint yaml, line and whitespace
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
Expand All @@ -13,7 +13,7 @@ repos:

# lint the dockerfiles
- repo: https://github.com/hadolint/hadolint
rev: v2.13.0-beta
rev: v2.13.1-beta
hooks:
- id: hadolint

Expand Down Expand Up @@ -41,7 +41,7 @@ repos:
- id: shellcheck

- repo: https://github.com/sirosen/check-jsonschema
rev: 0.29.0
rev: 0.29.4
hooks:
- id: check-github-actions
- id: check-github-workflows
Expand All @@ -54,12 +54,12 @@ repos:

# lint python formatting
- repo: https://github.com/psf/black
rev: 24.4.2
rev: 24.10.0
hooks:
- id: black

- repo: https://github.com/pycqa/flake8
rev: "7.1.0" # pick a git hash / tag to point to
rev: "7.1.1" # pick a git hash / tag to point to
hooks:
- id: flake8
args: ["--extend-ignore=W503,W504,E501"]
30 changes: 14 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
FROM ghcr.io/sdr-enthusiasts/docker-baseimage:mlatclient as buildimage
FROM ghcr.io/sdr-enthusiasts/docker-baseimage:mlatclient AS buildimage

SHELL ["/bin/bash", "-x", "-o", "pipefail", "-c"]
RUN \
--mount=type=bind,source=./,target=/app/ \
apt-get update -q -y && \
apt-get install -o Dpkg::Options::="--force-confnew" -y --no-install-recommends -q \
build-essential && \
# this baseimage has build-essential installed, no need to install it
#apt-get update -q -y && \
#apt-get install -o Dpkg::Options::="--force-confnew" -y --no-install-recommends -q \
# build-essential && \
gcc -static /app/downloads/distance-in-meters.c -o /distance -lm -O2

FROM ghcr.io/sdr-enthusiasts/docker-tar1090:latest

LABEL org.opencontainers.image.source = "https://github.com/sdr-enthusiasts/docker-adsb-ultrafeeder"
LABEL org.opencontainers.image.source="https://github.com/sdr-enthusiasts/docker-adsb-ultrafeeder"

ENV URL_MLAT_CLIENT_REPO="https://github.com/wiedehopf/mlat-client.git" \
ENV \
PRIVATE_MLAT="false" \
MLAT_INPUT_TYPE="auto"

Expand All @@ -33,26 +34,23 @@ RUN \
# Install all these packages:
apt-get update -q -y && \
apt-get install -o Dpkg::Options::="--force-confnew" -y --no-install-recommends -q \
"${KEPT_PACKAGES[@]}" \
"${TEMP_PACKAGES[@]}" && \
"${KEPT_PACKAGES[@]}" \
"${TEMP_PACKAGES[@]}" && \
# Get mlat-client
tar zxf /buildimage/mlatclient.tgz -C / && \
ln -s /usr/local/bin/mlat-client /usr/bin/mlat-client && \
# Get distance binary
cp -f /buildimage/distance /usr/local/bin/distance && \
# Add Container Version
[[ "${VERSION_BRANCH:0:1}" == "#" ]] && VERSION_BRANCH="main" || true && \
echo "$(TZ=UTC date +%Y%m%d-%H%M%S)_$(curl -ssL https://api.github.com/repos/$VERSION_REPO/commits/$VERSION_BRANCH | awk '{if ($1=="\"sha\":") {print substr($2,2,7); exit}}')_$VERSION_BRANCH" > /.CONTAINER_VERSION && \
# Clean up and install POST_PACKAGES:
apt-get remove -q -y "${TEMP_PACKAGES[@]}" && \
# apt-get install -o Dpkg::Options::="--force-confnew" -y --no-install-recommends -q \
# ${POST_PACKAGES[@]} && \
apt-get autoremove -q -o APT::Autoremove::RecommendsImportant=0 -o APT::Autoremove::SuggestsImportant=0 -y && \
{ [[ "${VERSION_BRANCH:0:1}" == "#" ]] && VERSION_BRANCH="main" || true; } && \
echo "$(TZ=UTC date +%Y%m%d-%H%M%S)_$(curl -ssL "https://api.github.com/repos/$VERSION_REPO/commits/$VERSION_BRANCH" | awk '{if ($1=="\"sha\":") {print substr($2,2,7); exit}}')_$VERSION_BRANCH" > /.CONTAINER_VERSION && \
# Clean up:
apt-get autoremove -q -o APT::Autoremove::RecommendsImportant=0 -o APT::Autoremove::SuggestsImportant=0 -y "${TEMP_PACKAGES[@]}" && \
apt-get clean -q -y && \
# test mlat-client
/usr/bin/mlat-client --help > /dev/null && \
# remove pycache introduced by testing mlat-client
find /usr | grep -E "/__pycache__$" | xargs rm -rf || true && \
{ find /usr | grep -E "/__pycache__$" | xargs rm -rf || true; } && \
rm -rf /src /tmp/* /var/lib/apt/lists/* /git /var/cache/* && \
#
# Do some stuff for kx1t's convenience:
Expand Down
Loading

0 comments on commit 63a3d55

Please sign in to comment.