-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adapt to building ARM images Signed-off-by: oamchronicle <[email protected]>
- Loading branch information
1 parent
29bd094
commit d74ec7b
Showing
25 changed files
with
253 additions
and
238 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,34 @@ | ||
ARG GOBUILDIMAGE | ||
ARG harbor_base_image_version | ||
ARG harbor_base_namespace | ||
FROM ${GOBUILDIMAGE} AS builder | ||
WORKDIR /harbor | ||
COPY ./ /harbor | ||
ENV CGO_ENABLED=0 | ||
RUN apt update \ | ||
&& apt install -y make \ | ||
&& cd /harbor \ | ||
&& make core | ||
|
||
|
||
ARG harbor_base_image_version | ||
ARG harbor_base_namespace | ||
FROM ${harbor_base_namespace}/harbor-core-base:${harbor_base_image_version} | ||
|
||
HEALTHCHECK CMD curl --fail -s http://localhost:8080/api/v2.0/ping || curl -k --fail -s https://localhost:8443/api/v2.0/ping || exit 1 | ||
COPY ./make/photon/common/install_cert.sh /harbor/ | ||
COPY ./make/photon/core/entrypoint.sh /harbor/ | ||
COPY ./make/photon/core/harbor_core /harbor/ | ||
COPY ./src/core/views /harbor/views | ||
COPY ./make/migrations /harbor/migrations | ||
COPY ./icons /harbor/icons | ||
COPY --from=builder /harbor/make/photon/common/install_cert.sh /harbor/ | ||
COPY --from=builder /harbor/make/photon/core/entrypoint.sh /harbor/ | ||
COPY --from=builder /harbor/make/photon/core/harbor_core /harbor/ | ||
COPY --from=builder /harbor/src/core/views /harbor/views | ||
COPY --from=builder /harbor/make/migrations /harbor/migrations | ||
COPY --from=builder /harbor/icons /harbor/icons | ||
|
||
RUN chown -R harbor:harbor /etc/pki/tls/certs \ | ||
&& chown -R harbor:harbor /harbor/ \ | ||
RUN chown -R harbor:harbor /harbor/ \ | ||
&& chmod u+x /harbor/entrypoint.sh \ | ||
&& chmod u+x /harbor/install_cert.sh \ | ||
&& chmod u+x /harbor/harbor_core | ||
|
||
WORKDIR /harbor/ | ||
USER harbor | ||
ENTRYPOINT ["/harbor/entrypoint.sh"] | ||
COPY make/photon/prepare/versions /harbor/ | ||
COPY --from=builder /harbor/make/photon/prepare/versions /harbor/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
FROM photon:5.0 | ||
FROM alpine:3.18 | ||
|
||
RUN tdnf install -y tzdata shadow >> /dev/null \ | ||
&& tdnf clean all \ | ||
&& groupadd -r -g 10000 harbor && useradd --no-log-init -r -m -g 10000 -u 10000 harbor \ | ||
RUN apk add --no-cache tzdata shadow \ | ||
&& groupadd -r -g 10000 harbor \ | ||
&& useradd -r -m -g 10000 -u 10000 harbor \ | ||
&& mkdir /harbor/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,21 @@ | ||
FROM photon:5.0 | ||
# Use Alpine as the base image | ||
FROM alpine:3.18 | ||
|
||
ENV PGDATA /var/lib/postgresql/data | ||
ENV PGDATA=/var/lib/postgresql/data | ||
|
||
RUN tdnf install -y shadow >> /dev/null \ | ||
# Install shadow tools (for useradd and groupadd), and create the postgres user and group | ||
# Install PostgreSQL 15, gzip, findutils, bc, and create necessary directories | ||
RUN apk add --no-cache shadow \ | ||
&& groupdel ping \ #compatible | ||
&& groupadd -r postgres --gid=999 \ | ||
&& useradd -m -r -g postgres --uid=999 postgres | ||
|
||
RUN tdnf install -y postgresql14-server >> /dev/null | ||
RUN tdnf install -y gzip postgresql15-server findutils bc >> /dev/null \ | ||
&& useradd -r -g postgres --uid=999 postgres \ | ||
&& apk add --no-cache postgresql15 postgresql15-client gzip findutils bc util-linux net-tools bash \ | ||
&& mkdir -p /docker-entrypoint-initdb.d \ | ||
&& mkdir -p /run/postgresql \ | ||
&& chown -R postgres:postgres /run/postgresql \ | ||
&& chmod 2777 /run/postgresql \ | ||
&& mkdir -p "$PGDATA" && chown -R postgres:postgres "$PGDATA" && chmod 777 "$PGDATA" \ | ||
&& sed -i "s|#listen_addresses = 'localhost'.*|listen_addresses = '*'|g" /usr/pgsql/15/share/postgresql/postgresql.conf.sample \ | ||
&& sed -i "s|#unix_socket_directories = '/tmp'.*|unix_socket_directories = '/run/postgresql'|g" /usr/pgsql/15/share/postgresql/postgresql.conf.sample \ | ||
&& tdnf clean all | ||
|
||
RUN tdnf erase -y toybox && tdnf install -y util-linux net-tools | ||
&& mkdir -p "$PGDATA" \ | ||
&& chown -R postgres:postgres "$PGDATA" \ | ||
&& chmod 777 "$PGDATA" \ | ||
&& sed -i "s|#listen_addresses = 'localhost'.*|listen_addresses = '*'|g" /usr/share/postgresql/postgresql.conf.sample \ | ||
&& sed -i "s|#unix_socket_directories = '/tmp'.*|unix_socket_directories = '/run/postgresql'|g" /usr/share/postgresql/postgresql.conf.sample |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
FROM photon:5.0 | ||
# Use Alpine as the base image | ||
FROM alpine:3.18 | ||
|
||
RUN tdnf install -y tzdata shadow >> /dev/null \ | ||
&& tdnf clean all \ | ||
&& groupadd -r -g 10000 harbor && useradd --no-log-init -r -m -g 10000 -u 10000 harbor \ | ||
# Install tzdata (for time zone data) and shadow (for groupadd and useradd commands) | ||
RUN apk add --no-cache tzdata shadow \ | ||
&& groupadd -r -g 10000 harbor \ | ||
&& useradd --no-log-init -r -m -g 10000 -u 10000 harbor \ | ||
&& mkdir /harbor/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
FROM photon:5.0 | ||
# Use Alpine as the base image | ||
FROM alpine:3.18 | ||
|
||
RUN tdnf install -y tzdata shadow >> /dev/null \ | ||
&& tdnf clean all \ | ||
&& groupadd -r -g 10000 harbor && useradd --no-log-init -r -m -g 10000 -u 10000 harbor | ||
# Install tzdata (for time zone data) and shadow (for groupadd and useradd commands) | ||
RUN apk add --no-cache tzdata shadow \ | ||
&& groupadd -r -g 10000 harbor \ | ||
&& useradd --no-log-init -r -m -g 10000 -u 10000 harbor \ | ||
&& mkdir /harbor/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
FROM photon:5.0 | ||
FROM alpine:3.18 | ||
|
||
RUN tdnf install -y cronie rsyslog logrotate shadow tar gzip sudo >> /dev/null\ | ||
RUN apk add --no-cache tzdata shadow tar gzip sudo cronie rsyslog logrotate \ | ||
&& mkdir /var/spool/rsyslog \ | ||
&& groupadd -r -g 10000 syslog && useradd --no-log-init -r -g 10000 -u 10000 syslog \ | ||
&& tdnf clean all \ | ||
&& chage -M 99999 root | ||
&& groupadd -r -g 10000 syslog \ | ||
&& useradd --no-log-init -r -g 10000 -u 10000 syslog |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
FROM photon:5.0 | ||
# Use Alpine as the base image | ||
FROM alpine:3.18 | ||
|
||
RUN tdnf install -y nginx shadow >> /dev/null \ | ||
&& tdnf clean all \ | ||
&& groupmod -g 10000 nginx && usermod -g 10000 -u 10000 -d /home/nginx -s /bin/bash nginx \ | ||
# Install nginx and shadow (for groupmod and usermod commands) | ||
RUN apk add --no-cache nginx shadow \ | ||
&& groupmod -g 10000 nginx \ | ||
&& usermod -g 10000 -u 10000 -d /home/nginx -s /bin/bash nginx \ | ||
&& mkdir -p /home/nginx \ | ||
&& ln -sf /dev/stdout /var/log/nginx/access.log \ | ||
&& ln -sf /dev/stderr /var/log/nginx/error.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
FROM photon:5.0 | ||
# Use Alpine as the base image | ||
FROM alpine:3.18 | ||
|
||
RUN tdnf install -y nginx shadow >> /dev/null \ | ||
&& tdnf clean all \ | ||
# Install nginx and shadow (for groupmod and usermod commands) | ||
RUN apk add --no-cache nginx shadow \ | ||
&& groupmod -g 10000 nginx \ | ||
&& usermod -g 10000 -u 10000 -d /home/nginx -s /bin/bash nginx \ | ||
&& mkdir -p /home/nginx \ | ||
&& ln -sf /dev/stdout /var/log/nginx/access.log \ | ||
&& ln -sf /dev/stderr /var/log/nginx/error.log \ | ||
&& groupmod -g 10000 nginx && usermod -g 10000 -u 10000 -d /home/nginx -s /bin/bash nginx \ | ||
&& chown -R nginx:nginx /etc/nginx | ||
&& ln -sf /dev/stderr /var/log/nginx/error.log |
Oops, something went wrong.