Skip to content

Commit

Permalink
fix: dev: Streamline the build process.
Browse files Browse the repository at this point in the history
  • Loading branch information
dallinb committed Oct 13, 2024
1 parent 866d120 commit 22a719f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 14 deletions.
20 changes: 18 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
FROM debian:12 AS download

ARG AVRO_TOOLS_VERSION

WORKDIR /tmp

# hadolint ignore=DL3008
RUN apt-get clean \
&& apt-get update \
&& apt-get install --no-install-recommends --yes ca-certificates gpg gpg-agent wget \
&& wget -qO KEYS https://downloads.apache.org/avro/KEYS \
&& gpg --import KEYS \
&& wget -qO avro-tools-${AVRO_TOOLS_VERSION}.jar https://repo1.maven.org/maven2/org/apache/avro/avro-tools/${AVRO_TOOLS_VERSION}/avro-tools-${AVRO_TOOLS_VERSION}.jar \
&& wget -qO avro-tools-${AVRO_TOOLS_VERSION}.jar.asc https://repo1.maven.org/maven2/org/apache/avro/avro-tools/${AVRO_TOOLS_VERSION}/avro-tools-${AVRO_TOOLS_VERSION}.jar.asc \
&& gpg --verify avro-tools-${AVRO_TOOLS_VERSION}.jar.asc avro-tools-${AVRO_TOOLS_VERSION}.jar

FROM amazoncorretto:11

ARG AVRO_TOOLS_VERSION
Expand All @@ -14,8 +30,8 @@ RUN yum clean all \
--user-group \
avro-tools

COPY --chown=avro-tools:avro-tools \
avro-tools-${AVRO_TOOLS_VERSION}.jar \
COPY --from=download --chown=avro-tools:avro-tools \
/tmp/avro-tools-${AVRO_TOOLS_VERSION}.jar \
/usr/local/avro-tools/avro-tools-${AVRO_TOOLS_VERSION}.jar
WORKDIR /usr/local/avro-tools
USER avro-tools
Expand Down
13 changes: 1 addition & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,7 @@ AVRO_TOOLS_VERSION = 1.12.0

all: clean lint build test trivy

KEYS:
curl --output KEYS https://downloads.apache.org/avro/KEYS
gpg --import KEYS

avro-tools-$(AVRO_TOOLS_VERSION).jar:
curl --output avro-tools-$(AVRO_TOOLS_VERSION).jar https://repo1.maven.org/maven2/org/apache/avro/avro-tools/$(AVRO_TOOLS_VERSION)/avro-tools-$(AVRO_TOOLS_VERSION).jar

avro-tools-$(AVRO_TOOLS_VERSION).jar.asc:
curl --output avro-tools-$(AVRO_TOOLS_VERSION).jar.asc https://repo1.maven.org/maven2/org/apache/avro/avro-tools/$(AVRO_TOOLS_VERSION)/avro-tools-$(AVRO_TOOLS_VERSION).jar.asc
gpg --verify avro-tools-$(AVRO_TOOLS_VERSION).jar.asc avro-tools-$(AVRO_TOOLS_VERSION).jar

build: KEYS avro-tools-$(AVRO_TOOLS_VERSION).jar avro-tools-$(AVRO_TOOLS_VERSION).jar.asc
build:
AVRO_TOOLS_VERSION=$(AVRO_TOOLS_VERSION) docker compose build avro-tools

changelog:
Expand Down

0 comments on commit 22a719f

Please sign in to comment.