Skip to content

Commit

Permalink
Fix docker dev image (#494)
Browse files Browse the repository at this point in the history
* Making dev image more safe

Dev image was bringing too much stuff to the image including logs

* Add ldflags

* update ignore rules
  • Loading branch information
6za authored Oct 4, 2022
1 parent b87da24 commit 8228dca
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
23 changes: 23 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
*.env
node_modules
.terraform
.gitlab-bot-access-token
.gitlab-runner-registration-token
.vscode
terraform-ssh-key
terraform-ssh-key.pub
kubeconfig_*
*/cypress/screenshots/
*/cypress/videos/
dist/
**/.DS_Store
/git
bin
.vscode/settings.json
logs/
/tmp
lint_log.txt
credentials
.idea
kubefirst
.git
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ logs/
lint_log.txt
credentials
.idea
kubefirst
5 changes: 3 additions & 2 deletions build/dev/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM --platform=linux/amd64 golang:1.18

WORKDIR /opt/kubefirst-install
ARG KUBEFIRST_VERSION=1.9.3

RUN apt-get update && \
apt-get install -y unzip curl jq vim unzip less \
Expand Down Expand Up @@ -43,8 +44,8 @@ WORKDIR /home/developer/kubefirst
COPY --chown=developer:developer . .

# download dependencies and prepare fresh installation
RUN go mod download && \
go build
RUN go mod download
RUN go build -ldflags="-X github.com/kubefirst/kubefirst/configs.K1Version=${KUBEFIRST_VERSION}" .

USER root
RUN mv ./kubefirst /usr/local/bin/ && chmod 777 /usr/local/bin/kubefirst
Expand Down

0 comments on commit 8228dca

Please sign in to comment.