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:
|
||||
- test
|
||||
- build
|
||||
|
||||
services:
|
||||
- leenooks/ci-docker:dind
|
||||
|
||||
variables:
|
||||
REGISTRY: registry.leenooks.net
|
||||
IMAGE: leenooks/base
|
||||
VERSION: "8"
|
||||
CACHETAG: build
|
||||
DOCKER_HOST: tcp://docker:2375
|
||||
|
||||
services:
|
||||
- docker:dind
|
||||
|
||||
before_script:
|
||||
- docker info
|
||||
- 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:
|
||||
stage: build
|
||||
script:
|
||||
- docker build -t ${IMAGE} .
|
||||
- docker tag ${IMAGE} ${REGISTRY}/${IMAGE}
|
||||
- docker push ${REGISTRY}/${IMAGE}
|
||||
- if [ -f init ]; then chmod 500 init; fi
|
||||
- docker pull ${CI_REGISTRY_IMAGE}:${CACHETAG} || true
|
||||
- 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:
|
||||
- docker
|
||||
- x86_64
|
||||
only:
|
||||
- c8
|
||||
|
@ -1,9 +1,7 @@
|
||||
# NAME leenooks/base
|
||||
# VERSION latest
|
||||
# BUILD docker build -t="leenooks/base" .
|
||||
# VERSION 8
|
||||
|
||||
FROM centos:latest
|
||||
MAINTAINER deon@leenooks.net
|
||||
FROM centos:8
|
||||
|
||||
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