test optimized build images
This commit is contained in:
parent
b7692b5543
commit
bdbb50702a
18
.gitlab-ci.yml
Normal file
18
.gitlab-ci.yml
Normal file
@ -0,0 +1,18 @@
|
||||
stages:
|
||||
- build
|
||||
|
||||
build_images:
|
||||
stage: build
|
||||
tags:
|
||||
- gobuild
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH == "main"
|
||||
before_script:
|
||||
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
|
||||
script:
|
||||
- docker build -t $CI_REGISTRY_IMAGE/golang:$CI_COMMIT_REF_SLUG.$CI_PIPELINE_ID $CI_PROJECT_DIR/golang
|
||||
- docker push $CI_REGISTRY_IMAGE/golang:$CI_COMMIT_REF_SLUG.$CI_PIPELINE_ID
|
||||
- docker build -t $CI_REGISTRY_IMAGE/alpine:$CI_COMMIT_REF_SLUG.$CI_PIPELINE_ID $CI_PROJECT_DIR/alpine
|
||||
- docker push $CI_REGISTRY_IMAGE/alpine:$CI_COMMIT_REF_SLUG.$CI_PIPELINE_ID
|
||||
after_script:
|
||||
- docker system prune --all --volumes --force
|
3
alpine/Dockerfile
Normal file
3
alpine/Dockerfile
Normal file
@ -0,0 +1,3 @@
|
||||
FROM penahub.gitlab.yandexcloud.net:5050/devops/dockerhub-backup/alpine as prod
|
||||
RUN apk add --no-cache ca-certificates
|
||||
RUN apk add tzdata
|
4
golang/Dockerfile
Normal file
4
golang/Dockerfile
Normal file
@ -0,0 +1,4 @@
|
||||
FROM penahub.gitlab.yandexcloud.net:5050/devops/dockerhub-backup/golang:latest as build
|
||||
WORKDIR /app
|
||||
RUN apk add git
|
||||
|
Loading…
Reference in New Issue
Block a user