How can i Remove DockerFile and use only ci file with kubernetes runner

2/5/2019

Right now I have a Docker file and a .gitlab-ci.yml , and SHELL runner

FROM node:latest
RUN cd /
RUN mkdir Brain
COPY . /Brain/
WORKDIR   /Brain/
RUN   npm   install
ENV  CASSANDRA_HOST_5="10.1.1.58:9042"
ENV  IP="0.0.0.0"
ENV PORT=6282
EXPOSE 6282
CMD npm start

and ci file

before_script:
   - export newver="0.1.0.117"
build:
  image: node:latest

stage: build
script:
- docker build -t Brain .
- docker tag pro 10.1.1.134:5000/Brain:$newver
- docker push 10.1.1.134:5000/Brain:$newver

deploy:
  stage: deploy
  script:
    - kubectl create -f brain-dep.yml 
    - kubectl create -f brain-service.yml

I dont want create image for every small change, I only want to keep stable images in local registry. now i have multiple version of Brain image, and also how can i have other services beside Brain (elasticsearch and..)

any suggestion

-- hesaum saboury
continuous-integration
gitlab
kubernetes

1 Answer

2/5/2019

Kubernetes has to be able to pull the image from somewhere. You can use an alternate repo for non-release builds or use some kind of naming scheme, and then clear out non-release builds more frequently.

-- coderanger
Source: StackOverflow