Skip to content

Commit

Permalink
devops: use dockerignore
Browse files Browse the repository at this point in the history
Signed-off-by: Login Victor <batazor111@gmail.com>
  • Loading branch information
batazor committed May 20, 2021
1 parent 7dc222d commit 913c7bc
Show file tree
Hide file tree
Showing 13 changed files with 167 additions and 10 deletions.
12 changes: 3 additions & 9 deletions ops/Makefile/docker.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# including docker.mk
CI_REGISTRY_IMAGE := batazor/${PROJECT_NAME}
CI_COMMIT_TAG := latest
DOCKER_BUILDKIT := 1

docker: docker-login docker-build docker-push ## docker login > build > push

Expand All @@ -11,16 +12,9 @@ docker-login: ## Docker login
@echo ${DOCKER_PASSWORD} | docker login -u ${DOCKER_USERNAME} --password-stdin

docker-build: ## Build the container
@echo docker build image ${CI_REGISTRY_IMAGE}:${CI_COMMIT_TAG}
@docker build -t ${CI_REGISTRY_IMAGE}:${CI_COMMIT_TAG} -f ops/dockerfile/api.Dockerfile .

@echo docker build image ${CI_REGISTRY_IMAGE}-logger:${CI_COMMIT_TAG}
@docker build -t ${CI_REGISTRY_IMAGE}-logger:${CI_COMMIT_TAG} -f ops/dockerfile/logger.Dockerfile .

@echo docker build image ${CI_REGISTRY_IMAGE}-ui-next:${CI_COMMIT_TAG}
@docker build -t ${CI_REGISTRY_IMAGE}-api:${CI_COMMIT_TAG} -f ops/dockerfile/api.Dockerfile .
@docker build -t ${CI_REGISTRY_IMAGE}-logger:${CI_COMMIT_TAG} -f ops/dockerfile/logger.Dockerfile .
@docker build -t ${CI_REGISTRY_IMAGE}-ui-next:${CI_COMMIT_TAG} -f ops/dockerfile/ui-next.Dockerfile .

@echo docker build image ${CI_REGISTRY_IMAGE}-landing:${CI_COMMIT_TAG}
@docker build -t ${CI_REGISTRY_IMAGE}-landing:${CI_COMMIT_TAG} -f ops/dockerfile/landing.Dockerfile .

docker-push: ## Publish the container
Expand Down
15 changes: 15 additions & 0 deletions ops/dockerfile/api.Dockerfile.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.*
danger
docs
internal
ops
pkg/csi
pkg/flutter
pkg/ml
third_party
ui
*.yml

!vendor
!pkg
!internal
15 changes: 15 additions & 0 deletions ops/dockerfile/auth.Dockerfile.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.*
danger
docs
internal
ops
pkg/csi
pkg/flutter
pkg/ml
third_party
ui
*.yml

!vendor
!pkg
!internal
15 changes: 15 additions & 0 deletions ops/dockerfile/bot.Dockerfile.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.*
danger
docs
internal
ops
pkg/csi
pkg/flutter
pkg/ml
third_party
ui
*.yml

!vendor
!pkg
!internal
14 changes: 14 additions & 0 deletions ops/dockerfile/csi.Dockerfile.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.*
danger
docs
internal
ops
pkg/flutter
pkg/ml
third_party
ui
*.yml

!vendor
!pkg
!internal
2 changes: 1 addition & 1 deletion ops/dockerfile/landing.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN apk add --no-cache alpine-sdk python3 libsass \
WORKDIR /app
COPY ./ui/landing /app/

RUN npm i && \
RUN npm i --force && \
npm rebuild node-sass && \
npm run generate

Expand Down
14 changes: 14 additions & 0 deletions ops/dockerfile/landing.Dockerfile.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.*
cmd
danger
docs
internal
ops
pkg
third_party
ui
*.yml

!ui/landing
!ops/dockerfile/conf/landing.local
!ops/docker-compose/gateway/nginx
15 changes: 15 additions & 0 deletions ops/dockerfile/link.Dockerfile.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.*
danger
docs
internal
ops
pkg/csi
pkg/flutter
pkg/ml
third_party
ui
*.yml

!vendor
!pkg
!internal
15 changes: 15 additions & 0 deletions ops/dockerfile/logger.Dockerfile.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.*
danger
docs
internal
ops
pkg/csi
pkg/flutter
pkg/ml
third_party
ui
*.yml

!vendor
!pkg
!internal
15 changes: 15 additions & 0 deletions ops/dockerfile/metadata.Dockerfile.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.*
danger
docs
internal
ops
pkg/csi
pkg/flutter
pkg/ml
third_party
ui
*.yml

!vendor
!pkg
!internal
15 changes: 15 additions & 0 deletions ops/dockerfile/notify.Dockerfile.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.*
danger
docs
internal
ops
pkg/csi
pkg/flutter
pkg/ml
third_party
ui
*.yml

!vendor
!pkg
!internal
15 changes: 15 additions & 0 deletions ops/dockerfile/proxy.Dockerfile.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.*
danger
docs
internal
ops
pkg/csi
pkg/flutter
pkg/ml
third_party
ui
*.yml

!vendor
!pkg
!internal
15 changes: 15 additions & 0 deletions ops/dockerfile/ui-next.Dockerfile.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.*
danger
docs
internal
ops
pkg/csi
pkg/flutter
pkg/ml
third_party
ui
*.yml

!vendor
!pkg
!internal

0 comments on commit 913c7bc

Please sign in to comment.