Skip to content

Instantly share code, notes, and snippets.

@lox
Last active April 23, 2018 22:53
Show Gist options
  • Save lox/a0dbe5868556e470afd6697b34eb37c4 to your computer and use it in GitHub Desktop.
Save lox/a0dbe5868556e470afd6697b34eb37c4 to your computer and use it in GitHub Desktop.
Test caching shared base image in docker-compose-buildkite-plugin
version: '3.4'
services:
base_service:
build: .
service1:
build: .
service2:
build: .
FROM alpine:3.3
RUN echo "CACHE MISS" && sleep 10
RUN apk update && \
apk add --no-cache openssl && \
rm -rf /var/cache/apk/*
RUN echo "CACHE MISS" && sleep 10
RUN openssl req -x509 -nodes -newkey rsa:4096 -keyout /key.pem -out /certificate.pem -days 720 -subj "/C=US/ST=State/L=City/O=Department/OU=Company/CN=localhost.localdomain"
RUN echo "CACHE MISS" && sleep 10
steps:
- name: ':docker: :package:'
plugins:
'docker-compose#aa08b09':
build: base_service
image-repository: lox24/test-docker-compose-plugin
- wait
- name: 'task 1'
command: cat /certificate.pem
plugins:
'docker-compose#aa08b09':
run: service1
cache_from: base_service
- name: 'task 2'
command: cat /certificate.pem
plugins:
'docker-compose#aa08b09':
run: service2
cache_from: base_service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment