Skip to content

Commit 8547527

Browse files
committed
remove code already in base image
1 parent 5de8b7d commit 8547527

File tree

1 file changed

+2
-38
lines changed

1 file changed

+2
-38
lines changed

airbyte_cdk/utils/docker_image_templates.py

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -111,52 +111,16 @@
111111
112112
# Build arguments
113113
ARG JDK_VERSION=21-al2023
114+
ARG BASE_IMAGE=amazoncorretto:${JDK_VERSION}
114115
115116
# Base image - using Amazon Corretto (Amazon's distribution of OpenJDK)
116-
FROM amazoncorretto:${JDK_VERSION}
117+
FROM ${BASE_IMAGE}
117118
ARG CONNECTOR_KEBAB_NAME
118119
119-
# Install required packages and set up the non-root user
120-
RUN set -o xtrace && \
121-
yum install -y shadow-utils tar openssl findutils && \
122-
yum update -y --security && \
123-
yum clean all && \
124-
rm -rf /var/cache/yum && \
125-
echo "Creating airbyte user and group..." && \
126-
groupadd --gid 1000 airbyte && \
127-
useradd --uid 1000 --gid airbyte --shell /bin/bash --create-home airbyte && \
128-
echo "Creating directories..." && \
129-
mkdir /secrets && \
130-
mkdir /config && \
131-
mkdir --mode 755 /airbyte && \
132-
mkdir --mode 755 /custom_cache && \
133-
echo "Setting permissions..." && \
134-
chown -R airbyte:airbyte /airbyte && \
135-
chown -R airbyte:airbyte /custom_cache && \
136-
chown -R airbyte:airbyte /secrets && \
137-
chown -R airbyte:airbyte /config && \
138-
chown -R airbyte:airbyte /usr/share/pki/ca-trust-source && \
139-
chown -R airbyte:airbyte /etc/pki/ca-trust && \
140-
chown -R airbyte:airbyte /tmp
141-
142-
# Download required scripts
143-
WORKDIR /airbyte
144-
ADD https://raw.githubusercontent.com/airbytehq/airbyte/6d8a3a2bc4f4ca79f10164447a90fdce5c9ad6f9/airbyte-integrations/bases/base/base.sh /airbyte/base.sh
145-
ADD https://raw.githubusercontent.com/airbytehq/airbyte/6d8a3a2bc4f4ca79f10164447a90fdce5c9ad6f9/airbyte-integrations/bases/base-java/javabase.sh /airbyte/javabase.sh
146-
ADD https://dtdg.co/latest-java-tracer /airbyte/dd-java-agent.jar
147-
148120
# Set permissions for downloaded files
149121
RUN chmod +x /airbyte/base.sh /airbyte/javabase.sh && \
150122
chown airbyte:airbyte /airbyte/base.sh /airbyte/javabase.sh /airbyte/dd-java-agent.jar
151123
152-
# Set environment variables
153-
# These variables tell base.sh what to do:
154-
ENV AIRBYTE_SPEC_CMD="/airbyte/javabase.sh --spec"
155-
ENV AIRBYTE_CHECK_CMD="/airbyte/javabase.sh --check"
156-
ENV AIRBYTE_DISCOVER_CMD="/airbyte/javabase.sh --discover"
157-
ENV AIRBYTE_READ_CMD="/airbyte/javabase.sh --read"
158-
ENV AIRBYTE_WRITE_CMD="/airbyte/javabase.sh --write"
159-
160124
# base.sh will set the classpath for the connector and invoke javabase.sh
161125
# using one of the above commands.
162126
ENV AIRBYTE_ENTRYPOINT="/airbyte/base.sh"

0 commit comments

Comments
 (0)