Skip to content
Open
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
15 changes: 6 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ARG PAUSE_IMAGE=${PAUSE_IMAGE}
ARG SQLITE_IMAGE=${SQLITE_IMAGE}

# Create Go CLI
FROM registry.access.redhat.com/ubi8:latest AS cli
FROM registry.redhat.io/ubi8/go-toolset:1.24.4 AS cli

# Need to duplicate these, otherwise they won't be available to the stage
ARG RELEASE_VERSION=${RELEASE_VERSION}
Expand All @@ -18,14 +18,8 @@ ARG REDIS_IMAGE=${REDIS_IMAGE}
ARG PAUSE_IMAGE=${PAUSE_IMAGE}
ARG SQLITE_IMAGE=${SQLITE_IMAGE}

ENV GOROOT=/usr/local/go
ENV PATH=$GOPATH/bin:$GOROOT/bin:$PATH

# Get Go binary
RUN curl -o go1.21.13.linux-amd64.tar.gz https://dl.google.com/go/go1.21.13.linux-amd64.tar.gz
RUN tar -xzf go1.21.13.linux-amd64.tar.gz &&\
mv go /usr/local

# Switch to root to copy files and work
USER root
COPY . /cli
WORKDIR /cli

Expand All @@ -41,6 +35,9 @@ RUN go build -v \
-ldflags "-X github.com/quay/mirror-registry/cmd.releaseVersion=${RELEASE_VERSION} -X github.com/quay/mirror-registry/cmd.eeImage=${EE_IMAGE} -X github.com/quay/mirror-registry/cmd.pauseImage=${PAUSE_IMAGE} -X github.com/quay/mirror-registry/cmd.quayImage=${QUAY_IMAGE} -X github.com/quay/mirror-registry/cmd.redisImage=${REDIS_IMAGE} -X github.com/quay/mirror-registry/cmd.sqliteImage=${SQLITE_IMAGE}" \
-o mirror-registry

# Switch back to UBI default user
USER 1001

# Create Ansible Execution Environment
FROM $EE_BASE_IMAGE as galaxy
ARG ANSIBLE_GALAXY_CLI_COLLECTION_OPTS=
Expand Down
15 changes: 6 additions & 9 deletions Dockerfile.online
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ARG EE_BASE_IMAGE=${EE_BASE_IMAGE}
ARG EE_BUILDER_IMAGE=${EE_BUILDER_IMAGE}

# Create Go CLI
FROM registry.redhat.io/ubi8:latest AS cli
FROM registry.redhat.io/ubi8/go-toolset:1.24.4 AS cli

# Need to duplicate these, otherwise they won't be available to the stage
ARG RELEASE_VERSION=${RELEASE_VERSION}
Expand All @@ -13,14 +13,8 @@ ARG REDIS_IMAGE=${REDIS_IMAGE}
ARG PAUSE_IMAGE=${PAUSE_IMAGE}
ARG SQLITE_IMAGE=${SQLITE_IMAGE}

ENV GOROOT=/usr/local/go
ENV PATH=$GOPATH/bin:$GOROOT/bin:$PATH

# Get Go binary
RUN curl -o go1.21.13.linux-amd64.tar.gz https://dl.google.com/go/go1.21.13.linux-amd64.tar.gz
RUN tar -xzf go1.21.13.linux-amd64.tar.gz &&\
mv go /usr/local

# Switch to root to copy files and work
USER root
COPY . /cli
WORKDIR /cli

Expand All @@ -36,6 +30,9 @@ RUN go build -v \
-ldflags "-X github.com/quay/mirror-registry/cmd.releaseVersion=${RELEASE_VERSION} -X github.com/quay/mirror-registry/cmd.eeImage=${EE_IMAGE} -X github.com/quay/mirror-registry/cmd.pauseImage=${PAUSE_IMAGE} -X github.com/quay/mirror-registry/cmd.quayImage=${QUAY_IMAGE} -X github.com/quay/mirror-registry/cmd.redisImage=${REDIS_IMAGE} -X github.com/quay/mirror-registry/cmd.sqliteImage=${SQLITE_IMAGE}" \
-o mirror-registry

# Switch back to UBI default user
USER 1001

# Create Ansible Execution Environment
FROM $EE_BASE_IMAGE as galaxy
ARG ANSIBLE_GALAXY_CLI_COLLECTION_OPTS=
Expand Down
Loading