Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added controller-gen installation in the golang image #117

Merged
merged 2 commits into from
Nov 19, 2024
Merged
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
4 changes: 4 additions & 0 deletions docker-compose.golang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ services:
dockerfile: golang/Dockerfile
args:
VERSION: "1.21"
# Need to override this because default value doesn't work with this golang version
CONTROLLER_GEN_VERSION: "v0.14.0"

golang1.20:
image: okteto/golang:1.20
Expand All @@ -41,3 +43,5 @@ services:
args:
VERSION: "1.20"
DEBIAN_VERSION: "buster"
# Need to override this because default value doesn't work with this golang version
CONTROLLER_GEN_VERSION: "v0.14.0"
5 changes: 4 additions & 1 deletion golang/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@ ARG VERSION="1.23"
ARG DEBIAN_VERSION="bookworm"
FROM golang:${VERSION}-${DEBIAN_VERSION}

ARG CONTROLLER_GEN_VERSION="v0.16.5"

WORKDIR /usr/src/app

# setup okteto message
COPY bashrc /root/.bashrc

RUN go install github.com/codegangsta/gin@latest && \
go install github.com/go-delve/delve/cmd/dlv@latest && \
go install golang.org/x/tools/gopls@latest
go install golang.org/x/tools/gopls@latest && \
go install sigs.k8s.io/controller-tools/cmd/controller-gen@${CONTROLLER_GEN_VERSION}
RUN curl -sSfL https://raw.githubusercontent.com/air-verse/air/master/install.sh | sh -s -- -b /usr/bin

CMD ["bash"]
Loading