Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: fix docker warnings #11163

Merged
merged 1 commit into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docker/datahub-frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,24 @@ RUN apk --no-cache --update-cache --available upgrade \

ENV LD_LIBRARY_PATH="/lib:/lib64"

FROM base as unpack
FROM base AS unpack

COPY ./datahub-frontend.zip /
RUN unzip datahub-frontend.zip -d /tmp/out \
&& mv /tmp/out/main /datahub-frontend
COPY ./docker/monitoring/client-prometheus-config.yaml /datahub-frontend/
RUN chown -R datahub:datahub /datahub-frontend && chmod 755 /datahub-frontend

FROM base as prod-install
FROM base AS prod-install

COPY --from=unpack /datahub-frontend/ /datahub-frontend/

FROM base as dev-install
FROM base AS dev-install
# Dummy stage for development. Assumes code is built on your machine and mounted to this image.
# See this excellent thread https://github.com/docker/cli/issues/1134
VOLUME [ "/datahub-frontend" ]

FROM ${APP_ENV}-install as final
FROM ${APP_ENV}-install AS final
COPY --chown=datahub:datahub --chmod=755 ./docker/datahub-frontend/start.sh /
USER datahub

Expand Down
8 changes: 4 additions & 4 deletions docker/datahub-gms/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ FROM golang:1-alpine3.20 AS binary
# Re-declaring arg from above to make it available in this stage (will inherit default value)
ARG ALPINE_REPO_URL

ENV DOCKERIZE_VERSION v0.6.1
ENV DOCKERIZE_VERSION=v0.6.1
WORKDIR /go/src/github.com/jwilder

# Optionally set corporate mirror for apk
Expand Down Expand Up @@ -52,7 +52,7 @@ COPY --from=binary /go/bin/dockerize /usr/local/bin

ENV LD_LIBRARY_PATH="/lib:/lib64"

FROM base as prod-install
FROM base AS prod-install
COPY war.war /datahub/datahub-gms/bin/war.war
COPY metadata-models/src/main/resources/entity-registry.yml /datahub/datahub-gms/resources/entity-registry.yml
COPY docker/datahub-gms/start.sh /datahub/datahub-gms/scripts/start.sh
Expand All @@ -61,11 +61,11 @@ COPY docker/datahub-gms/jetty-jmx.xml /datahub/datahub-gms/scripts/jetty-jmx.xml
COPY docker/monitoring/client-prometheus-config.yaml /datahub/datahub-gms/scripts/prometheus-config.yaml
RUN chmod +x /datahub/datahub-gms/scripts/start.sh

FROM base as dev-install
FROM base AS dev-install
# Dummy stage for development. Assumes code is built on your machine and mounted to this image.
# See this excellent thread https://github.com/docker/cli/issues/1134

FROM ${APP_ENV}-install as final
FROM ${APP_ENV}-install AS final

RUN mkdir -p /etc/datahub/plugins/auth/resources

Expand Down
10 changes: 5 additions & 5 deletions docker/datahub-ingestion-base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ FROM golang:1-alpine3.20 AS dockerize-binary
# Re-declaring arg from above to make it available in this stage (will inherit default value)
ARG ALPINE_REPO_URL

ENV DOCKERIZE_VERSION v0.6.1
ENV DOCKERIZE_VERSION=v0.6.1
WORKDIR /go/src/github.com/jwilder

# Optionally set corporate mirror for apk
Expand All @@ -24,11 +24,11 @@ WORKDIR /go/src/github.com/jwilder/dockerize

RUN go install github.com/jwilder/dockerize@$DOCKERIZE_VERSION

FROM python:3.10 as base
FROM python:3.10 AS base

ARG GITHUB_REPO_URL

ENV DEBIAN_FRONTEND noninteractive
ENV DEBIAN_FRONTEND=noninteractive

# Optionally set corporate mirror for deb
ARG DEBIAN_REPO_URL
Expand Down Expand Up @@ -75,7 +75,7 @@ RUN python3 -m venv $VIRTUAL_ENV && \

ENTRYPOINT [ "/entrypoint.sh" ]

FROM ${BASE_IMAGE} as full-install
FROM ${BASE_IMAGE} AS full-install

USER 0
RUN apt-get update && apt-get install -y -qq \
Expand All @@ -102,7 +102,7 @@ RUN if [ $(arch) = "x86_64" ]; then \

USER datahub

FROM ${BASE_IMAGE} as slim-install
FROM ${BASE_IMAGE} AS slim-install
# Do nothing else on top of base

FROM ${APP_ENV}-install
Expand Down
12 changes: 6 additions & 6 deletions docker/datahub-ingestion/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ARG DOCKER_VERSION=head-full
ARG DEBIAN_REPO_URL=https://deb.debian.org/debian
ARG PIP_MIRROR_URL=https://pypi.python.org/simple

FROM $BASE_IMAGE:$DOCKER_VERSION as base
FROM $BASE_IMAGE:$DOCKER_VERSION AS base

# Optionally set corporate mirror for deb
USER 0
Expand All @@ -28,11 +28,11 @@ RUN sed -i.bak "s/__version__ = \"1\!0.0.0.dev0\"/__version__ = \"$(echo $RELEAS
cat src/datahub/__init__.py | grep __version__ && \
cat airflow-plugin/src/datahub_airflow_plugin/__init__.py | grep __version__

FROM base as slim-install
FROM base AS slim-install

RUN uv pip install --no-cache -e ".[base,datahub-rest,datahub-kafka,snowflake,bigquery,redshift,mysql,postgres,hive,clickhouse,glue,dbt,looker,lookml,tableau,powerbi,superset,datahub-business-glossary]"

FROM base as full-install-build
FROM base AS full-install-build

USER 0
RUN apt-get update && apt-get install -y -qq maven
Expand All @@ -44,14 +44,14 @@ RUN uv pip install --no-cache -e ".[base,all]" "./airflow-plugin[plugin-v2]" &&
datahub --version
RUN ./pyspark_jars.sh

FROM base as full-install
FROM base AS full-install

COPY --from=full-install-build ${VIRTUAL_ENV} ${VIRTUAL_ENV}

FROM base as dev-install
FROM base AS dev-install
# Dummy stage for development. Assumes code is built on your machine and mounted to this image.
# See this excellent thread https://github.com/docker/cli/issues/1134

FROM ${APP_ENV}-install as final
FROM ${APP_ENV}-install AS final

USER datahub
8 changes: 4 additions & 4 deletions docker/datahub-mae-consumer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ FROM golang:1-alpine3.20 AS binary
# Re-declaring arg from above to make it available in this stage (will inherit default value)
ARG ALPINE_REPO_URL

ENV DOCKERIZE_VERSION v0.6.1
ENV DOCKERIZE_VERSION=v0.6.1
WORKDIR /go/src/github.com/jwilder

# Optionally set corporate mirror for apk
Expand Down Expand Up @@ -47,18 +47,18 @@ COPY --from=binary /go/bin/dockerize /usr/local/bin

ENV LD_LIBRARY_PATH="/lib:/lib64"

FROM base as prod-install
FROM base AS prod-install
COPY mae-consumer-job.jar /datahub/datahub-mae-consumer/bin/
COPY metadata-models/src/main/resources/entity-registry.yml /datahub/datahub-mae-consumer/resources/entity-registry.yml
COPY docker/datahub-mae-consumer/start.sh /datahub/datahub-mae-consumer/scripts/
COPY docker/monitoring/client-prometheus-config.yaml /datahub/datahub-mae-consumer/scripts/prometheus-config.yaml
RUN chmod +x /datahub/datahub-mae-consumer/scripts/start.sh

FROM base as dev-install
FROM base AS dev-install
# Dummy stage for development. Assumes code is built on your machine and mounted to this image.
# See this excellent thread https://github.com/docker/cli/issues/1134

FROM ${APP_ENV}-install as final
FROM ${APP_ENV}-install AS final

RUN addgroup -S datahub && adduser -S datahub -G datahub
USER datahub
Expand Down
8 changes: 4 additions & 4 deletions docker/datahub-mce-consumer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ FROM golang:1-alpine3.20 AS binary
# Re-declaring arg from above to make it available in this stage (will inherit default value)
ARG ALPINE_REPO_URL

ENV DOCKERIZE_VERSION v0.6.1
ENV DOCKERIZE_VERSION=v0.6.1
WORKDIR /go/src/github.com/jwilder

# Optionally set corporate mirror for apk
Expand Down Expand Up @@ -45,7 +45,7 @@ RUN apk --no-cache --update-cache --available upgrade \
&& cp /usr/lib/jvm/java-17-openjdk/jre/lib/security/cacerts /tmp/kafka.client.truststore.jks
COPY --from=binary /go/bin/dockerize /usr/local/bin

FROM base as prod-install
FROM base AS prod-install
COPY mce-consumer-job.jar /datahub/datahub-mce-consumer/bin/
COPY metadata-models/src/main/resources/entity-registry.yml /datahub/datahub-mce-consumer/resources/entity-registry.yml
COPY docker/datahub-mce-consumer/start.sh /datahub/datahub-mce-consumer/scripts/
Expand All @@ -54,12 +54,12 @@ RUN chmod +x /datahub/datahub-mce-consumer/scripts/start.sh

ENV LD_LIBRARY_PATH="/lib:/lib64"

FROM base as dev-install
FROM base AS dev-install
# Dummy stage for development. Assumes code is built on your machine and mounted to this image.
# See this excellent thread https://github.com/docker/cli/issues/1134
COPY metadata-models/src/main/resources/entity-registry.yml /datahub/datahub-mce-consumer/resources/entity-registry.yml

FROM ${APP_ENV}-install as final
FROM ${APP_ENV}-install AS final

RUN addgroup -S datahub && adduser -S datahub -G datahub
USER datahub
Expand Down
8 changes: 4 additions & 4 deletions docker/datahub-upgrade/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ FROM golang:1-alpine3.20 AS binary
# Re-declaring arg from above to make it available in this stage (will inherit default value)
ARG ALPINE_REPO_URL

ENV DOCKERIZE_VERSION v0.6.1
ENV DOCKERIZE_VERSION=v0.6.1
WORKDIR /go/src/github.com/jwilder

# Optionally set corporate mirror for apk
Expand Down Expand Up @@ -51,15 +51,15 @@ COPY --from=binary /go/bin/dockerize /usr/local/bin

ENV LD_LIBRARY_PATH="/lib:/lib64"

FROM base as prod-install
FROM base AS prod-install
COPY datahub-upgrade.jar /datahub/datahub-upgrade/bin/
COPY metadata-models/src/main/resources/entity-registry.yml /datahub/datahub-gms/resources/entity-registry.yml

FROM base as dev-install
FROM base AS dev-install
# Dummy stage for development. Assumes code is built on your machine and mounted to this image.
# See this excellent thread https://github.com/docker/cli/issues/1134

FROM ${APP_ENV}-install as final
FROM ${APP_ENV}-install AS final

RUN addgroup -S datahub && adduser -S datahub -G datahub
USER datahub
Expand Down
2 changes: 1 addition & 1 deletion docker/elasticsearch-setup/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ FROM golang:1-alpine3.20 AS binary

ARG ALPINE_REPO_URL

ENV DOCKERIZE_VERSION v0.6.1
ENV DOCKERIZE_VERSION=v0.6.1
WORKDIR /go/src/github.com/jwilder

# Optionally set corporate mirror for apk
Expand Down
10 changes: 5 additions & 5 deletions docker/kafka-setup/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ ARG GITHUB_REPO_URL=https://github.com
ARG MAVEN_CENTRAL_REPO_URL=https://repo1.maven.org/maven2
ARG APACHE_DOWNLOAD_URL=null

# Using as a base image because to get the needed jars for confluent utils
FROM confluentinc/cp-base-new:$KAFKA_DOCKER_VERSION as confluent_base
# Using AS a base image because to get the needed jars for confluent utils
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likely a typo not needed for documentation.

FROM confluentinc/cp-base-new:$KAFKA_DOCKER_VERSION AS confluent_base

ARG MAVEN_CENTRAL_REPO_URL
ARG SNAKEYAML_VERSION="2.0"
Expand All @@ -22,8 +22,8 @@ ARG ALPINE_REPO_URL
ARG APACHE_DOWNLOAD_URL
ARG GITHUB_REPO_URL

ENV KAFKA_VERSION 3.7.0
ENV SCALA_VERSION 2.13
ENV KAFKA_VERSION=3.7.0
ENV SCALA_VERSION=2.13

LABEL name="kafka" version=${KAFKA_VERSION}

Expand All @@ -44,7 +44,7 @@ RUN mkdir -p /opt \
&& rm -rf /tmp/* \
&& apk del --purge .build-deps

ENV PATH /sbin:/opt/kafka/bin/:$PATH
ENV PATH=/sbin:/opt/kafka/bin/:$PATH

WORKDIR /opt/kafka

Expand Down
2 changes: 1 addition & 1 deletion docker/mysql-setup/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ FROM golang:1-alpine3.20 AS binary

ARG ALPINE_REPO_URL

ENV DOCKERIZE_VERSION v0.6.1
ENV DOCKERIZE_VERSION=v0.6.1
WORKDIR /go/src/github.com/jwilder

# Optionally set corporate mirror for apk
Expand Down
2 changes: 1 addition & 1 deletion docker/postgres-setup/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ FROM golang:1-alpine3.20 AS binary

ARG ALPINE_REPO_URL

ENV DOCKERIZE_VERSION v0.6.1
ENV DOCKERIZE_VERSION=v0.6.1
WORKDIR /go/src/github.com/jwilder

# Optionally set corporate mirror for apk
Expand Down
Loading