feat: Use buildx in CI
This commit is contained in:
		
							parent
							
								
									31a92bc86a
								
							
						
					
					
						commit
						7b7abec185
					
				
					 2 changed files with 5 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -72,15 +72,16 @@ build_image_for_commit:
 | 
			
		|||
  needs:
 | 
			
		||||
    - fetch_asset_dependencies
 | 
			
		||||
    - fetch_application_dependencies
 | 
			
		||||
  image: "docker:19.03.12"
 | 
			
		||||
  image: "docker:20.10"
 | 
			
		||||
  only:
 | 
			
		||||
    - master
 | 
			
		||||
  services:
 | 
			
		||||
    - name: docker:19.03.12-dind
 | 
			
		||||
    - name: docker:20.10-dind
 | 
			
		||||
  script:
 | 
			
		||||
    - docker login "https://${CI_REGISTRY}" -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD
 | 
			
		||||
    - docker pull $CI_REGISTRY_IMAGE:latest || true
 | 
			
		||||
    - docker buildx build --cache-from $CI_REGISTRY_IMAGE:latest -t $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA .
 | 
			
		||||
    - export DOCKER_BUILDKIT=1
 | 
			
		||||
    - docker build --cache-from $CI_REGISTRY_IMAGE:latest -t $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA --build-arg BUILDKIT_INLINE_CACHE=1 .
 | 
			
		||||
    - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
 | 
			
		||||
 | 
			
		||||
deploy_to_tags:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -24,6 +24,7 @@ ADD ./apps/admin/mix.exs /root/app/apps/admin/
 | 
			
		|||
ADD ./apps/app/mix.exs /root/app/apps/app/
 | 
			
		||||
ADD ./apps/content/mix.exs /root/app/apps/content/
 | 
			
		||||
ADD ./apps/core/mix.exs /root/app/apps/core/
 | 
			
		||||
ADD ./deps /root/app/deps
 | 
			
		||||
RUN mix deps.get
 | 
			
		||||
RUN mix deps.compile
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue