Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
3179c0dedb | ||
|
a0f9344d25 | ||
|
3bef50d569 | ||
|
05e533e0fd | ||
|
b4fd617e7e | ||
|
1967ccebda | ||
|
7c74cbf76e | ||
|
4bbc2fb76b | ||
|
025abc9d8e |
@ -1,25 +1,42 @@
|
|||||||
image: leenooks/ci-docker:latest
|
image: docker:latest
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
|
- test
|
||||||
- build
|
- build
|
||||||
|
|
||||||
services:
|
|
||||||
- leenooks/ci-docker:dind
|
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
REGISTRY: registry.leenooks.net
|
VERSION: "8"
|
||||||
IMAGE: leenooks/base
|
CACHETAG: build
|
||||||
|
DOCKER_HOST: tcp://docker:2375
|
||||||
|
|
||||||
|
services:
|
||||||
|
- docker:dind
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- docker info
|
- docker info
|
||||||
- docker version
|
- docker version
|
||||||
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN ${REGISTRY}
|
- echo "$CI_JOB_TOKEN" | docker login -u "$CI_REGISTRY_USER" "$CI_REGISTRY" --password-stdin
|
||||||
|
|
||||||
|
test:
|
||||||
|
stage: test
|
||||||
|
script:
|
||||||
|
- cat /etc/hosts
|
||||||
|
- env|sort
|
||||||
|
- docker build -t ${CI_REGISTRY_IMAGE}:${VERSION} .
|
||||||
|
- docker images
|
||||||
|
only:
|
||||||
|
- debug
|
||||||
|
|
||||||
build:
|
build:
|
||||||
stage: build
|
stage: build
|
||||||
script:
|
script:
|
||||||
- docker build -t ${IMAGE} .
|
- if [ -f init ]; then chmod 500 init; fi
|
||||||
- docker tag ${IMAGE} ${REGISTRY}/${IMAGE}
|
- docker pull ${CI_REGISTRY_IMAGE}:${CACHETAG} || true
|
||||||
- docker push ${REGISTRY}/${IMAGE}
|
- docker build --cache-from ${CI_REGISTRY_IMAGE}:${CACHETAG} -t ${CI_REGISTRY_IMAGE}:${VERSION} -t ${CI_REGISTRY_IMAGE}:${CACHETAG} .
|
||||||
|
- docker push ${CI_REGISTRY_IMAGE}:${VERSION}
|
||||||
|
- docker push ${CI_REGISTRY_IMAGE}:${CACHETAG}
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
|
- x86_64
|
||||||
|
only:
|
||||||
|
- c8
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
# NAME leenooks/base
|
# NAME leenooks/base
|
||||||
# VERSION latest
|
# VERSION 8
|
||||||
# BUILD docker build -t="leenooks/base" .
|
|
||||||
|
|
||||||
FROM centos:latest
|
FROM centos:8
|
||||||
MAINTAINER deon@leenooks.net
|
|
||||||
|
|
||||||
RUN ln -sf /usr/share/zoneinfo/Australia/Melbourne /etc/localtime
|
RUN ln -sf /usr/share/zoneinfo/Australia/Melbourne /etc/localtime
|
||||||
RUN yum -y install http://yum.leenooks.net/repo-7.rpm && yum -y update && yum clean all && rm -rf /var/tmp/*
|
RUN yum -y install http://yum.leenooks.net/repo-8.rpm epel-release && yum clean all && rm -rf /var/tmp/*
|
||||||
|
Reference in New Issue
Block a user