Skip to content

Commit

Permalink
Merge pull request Stratio#4 from Stratio/PLT-589
Browse files Browse the repository at this point in the history
Start changes to builder
  • Loading branch information
iamjanr authored Aug 22, 2024
2 parents f4c8dff + a0839c0 commit 88ce164
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 10 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changelog

## 1.6.0-0.1.0 (upcoming)
## 1.6.1-0.1.0 (upcoming)

* Add the PRs that have not yet been merged
34 changes: 29 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

# Build the manager binary
FROM golang:1.21.9@sha256:ff6cfbd291c157a5b67e121b050e80a646a88b55de5c489a5c07acb9528a1feb as builder
FROM golang:1.21.9 AS builder
WORKDIR /workspace

# Run this with docker build --build_arg $(go env GOPROXY) to override the goproxy
Expand All @@ -23,23 +23,47 @@ ENV GOPROXY=$goproxy
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum

# Cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
RUN go mod download

# Copy the sources
COPY ./ ./

# Build
# Build the binary
ARG ARCH
ARG LDFLAGS
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} \
go build -a -trimpath -ldflags "${LDFLAGS} -extldflags '-static'" \
-o manager .

# Copy the controller-manager into a thin image
FROM cgr.dev/chainguard/static:latest
# Final stage with Alpine
FROM alpine:3.18

# Install dependencies
RUN apk add --no-cache \
git \
python3 \
py3-pip \
curl \
bash \
libc6-compat

# Install Google Cloud SDK
RUN curl -LO https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-428.0.0-linux-x86_64.tar.gz \
&& tar -xzvf google-cloud-sdk-428.0.0-linux-x86_64.tar.gz \
&& rm google-cloud-sdk-428.0.0-linux-x86_64.tar.gz \
&& ./google-cloud-sdk/install.sh -q

# Update PATH to include the Google Cloud SDK directory
ENV PATH="/google-cloud-sdk/bin:${PATH}"

# Install Python dependencies for gcloud
RUN pip3 install --upgrade pip \
&& pip3 install -U crcmod

WORKDIR /
COPY --from=builder /workspace/manager .
USER nobody
ENTRYPOINT ["/manager"]
ENTRYPOINT ["/manager"]
6 changes: 3 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
@Library('libpipelines@master') _

hose {
EMAIL = 'clouds-integration@stratio.com'
EMAIL = 'none@stratio.com'
BUILDTOOL = 'make'
VERSIONING_TYPE = 'stratioVersion-3-3'
UPSTREAM_VERSION = '1.6.0'
UPSTREAM_VERSION = '1.6.1'
DEPLOYONPRS = true
DEVTIMEOUT = 30
ANCHORE_POLICY = "production"
Expand All @@ -14,6 +14,6 @@ hose {
BUILDTOOL_MEMORY_LIMIT = "4096Mi"

DEV = { config ->
doDocker(conf:config, dockerfile: 'Dockerfile', image:'cluster-api-provider-gcp')
doDocker(conf:config, dockerfile: 'Dockerfile', image:'cluster-api-gcp-controller')
}
}
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.0-SNAPSHOT
0.1.0-SNAPSHOT
14 changes: 14 additions & 0 deletions hack/custom/change-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash -e

BASEDIR=`dirname $0`/../..

cd $BASEDIR

if [[ -z "$1" ]]; then
VERSION=$(cat $BASEDIR/VERSION)
else
VERSION=$1
fi

echo "Modifying cluster-provisioner version to: $1"
echo $VERSION > VERSION

0 comments on commit 88ce164

Please sign in to comment.