Skip to content

Commit

Permalink
Squash docker layers after building
Browse files Browse the repository at this point in the history
  • Loading branch information
zootalures committed Feb 11, 2021
1 parent 740b95d commit aeb99b0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .circleci/install-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,9 @@ set -ex
docker version || true
sudo service docker stop || true
curl -fsSL https://get.docker.com/ | sudo sh
# required for image squashing
# sudo cat /etc/docker/daemon.json
echo '{"experimental":true}' | sudo tee /etc/docker/daemon.json
sudo service docker restart

docker version
10 changes: 5 additions & 5 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,28 +41,28 @@ mvn -B deploy -DaltDeploymentRepository=localStagingDir::default::file://${REP

(
cd images/build
./docker-build.sh --no-cache -t fnproject/fn-java-fdk-build:${BUILD_VERSION} .
./docker-build.sh --squash --no-cache -t fnproject/fn-java-fdk-build:${BUILD_VERSION} .
)

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

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

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

(
workdir=$(pwd)/runtime
cd images/build-native
./docker-build.sh ${workdir}
./docker-build.sh ${workdir}
)

(
Expand Down

0 comments on commit aeb99b0

Please sign in to comment.