Skip to content

Commit 6738e9c

Browse files
committed
Attempt to cache the docker container
This is a big 2.7GB download. It'd be nice if we didn't have to keep redownloading it...
1 parent 3d3dd8d commit 6738e9c

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,19 @@ jobs:
3737
run: ./configure --with-IBM_DB2=$PWD/clidriver
3838
- name: make
3939
run: make V=1
40+
- name: Cache container
41+
id: cache-docker
42+
uses: actions/cache@v2
43+
with:
44+
path: image-cache
45+
key: ${{ runner.os }}-image-cache
46+
- name: Download container
47+
if: steps.cache-docker.outputs.cache-hit != 'true'
48+
run: |
49+
docker pull ibmcom/db2
50+
docker save -o image-cache/db2.tar ibmcom/db2
51+
if: steps.cache-docker.outputs.cache-hit == 'true'
52+
run: docker load -i image-cache/db2.tar
4053
- name: Set up Db2 LUW in Docker
4154
# XXX: Should we be caching the Docker image? Are we creating the necessary things?
4255
# Adapted from the Travis setup with the changes used for the current
@@ -51,7 +64,6 @@ jobs:
5164
Database=sample
5265
EOF
5366
mkdir database
54-
docker pull ibmcom/db2
5567
docker run --name db2 --privileged=true -p 60000:50000 -e DB2INST1_PASSWORD=password -e LICENSE=accept -e DBNAME=sample -v database:/database -itd ibmcom/db2
5668
docker ps -as
5769
while true

0 commit comments

Comments
 (0)