Add Dockerfile

This commit is contained in:
2025-11-04 17:47:35 +00:00
parent 4c19b4dc66
commit 7c0793f53d

33
Dockerfile Normal file
View File

@@ -0,0 +1,33 @@
# Use a lightweight Linux image
FROM ubuntu:22.04
# Install dependencies
RUN apt-get update && \
apt-get install -y curl tar wget docker.io docker-compose sudo && \
rm -rf /var/lib/apt/lists/*
# Set environment variables
ENV HARBOR_VERSION=2.9.0
ENV HARBOR_INSTALLER=harbor-online-installer-v$HARBOR_VERSION.tgz
ENV HARBOR_DIR=/opt/harbor
# Create directory
RUN mkdir -p $HARBOR_DIR
WORKDIR $HARBOR_DIR
# Download and extract Harbor
RUN curl -LO https://github.com/goharbor/harbor/releases/download/v$HARBOR_VERSION/$HARBOR_INSTALLER && \
tar xvf $HARBOR_INSTALLER && \
rm $HARBOR_INSTALLER
# Set workdir to the Harbor folder
WORKDIR $HARBOR_DIR/harbor
# Copy a default harbor.yml config (optional)
# COPY harbor.yml ./harbor.yml
# Expose default Harbor ports
EXPOSE 80 443 4443
# Run the installer
CMD ["./install.sh", "--with-notary", "--with-clair"]