Skip to content

Commit d21e446

Browse files
committed
Squash docker layers after building
1 parent 740b95d commit d21e446

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

.circleci/install-docker.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,9 @@ set -ex
55
docker version || true
66
sudo service docker stop || true
77
curl -fsSL https://get.docker.com/ | sudo sh
8+
# required for image squashing
9+
cat /etc/docker/daemon.json
10+
echo '{"experimental":true}' > /etc/docker/daemon.json
11+
sudo service docker restart
12+
813
docker version

build.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,28 +41,28 @@ mvn -B deploy -DaltDeploymentRepository=localStagingDir::default::file://${REP
4141

4242
(
4343
cd images/build
44-
./docker-build.sh --no-cache -t fnproject/fn-java-fdk-build:${BUILD_VERSION} .
44+
./docker-build.sh --squash --no-cache -t fnproject/fn-java-fdk-build:${BUILD_VERSION} .
4545
)
4646

4747
(
4848
cd images/build
49-
./docker-build.sh --no-cache -f Dockerfile-jdk11 -t fnproject/fn-java-fdk-build:jdk11-${BUILD_VERSION} .
49+
./docker-build.sh --squash --no-cache -f Dockerfile-jdk11 -t fnproject/fn-java-fdk-build:jdk11-${BUILD_VERSION} .
5050
)
5151

5252
(
5353
cd runtime
54-
docker build --no-cache -t fnproject/fn-java-fdk:${BUILD_VERSION} -f ../images/runtime/Dockerfile .
54+
docker build --squash --no-cache -t fnproject/fn-java-fdk:${BUILD_VERSION} -f ../images/runtime/Dockerfile .
5555
)
5656

5757
(
5858
cd runtime
59-
docker build --no-cache -f ../images/runtime/Dockerfile-jre11 -t fnproject/fn-java-fdk:jre11-${BUILD_VERSION} .
59+
docker build --squash --no-cache -f ../images/runtime/Dockerfile-jre11 -t fnproject/fn-java-fdk:jre11-${BUILD_VERSION} .
6060
)
6161

6262
(
6363
workdir=$(pwd)/runtime
6464
cd images/build-native
65-
./docker-build.sh ${workdir}
65+
./docker-build.sh ${workdir}
6666
)
6767

6868
(

0 commit comments

Comments
 (0)