Decrease time of docker build (#5861)

* decrease docker build time

* decrease docker build time

* decrease docker build time

* decrease docker build time

* updare CHANGELOG

* decrease docker build time

Co-authored-by: Yuliya Sharafitdinova <yuliy.sharafitdinova@x5.ru>
Co-authored-by: Victor Baranov <baranov.viktor.27@gmail.com>
pull/5863/head
Sharafitdinova 2 years ago committed by GitHub
parent 47baa32a8f
commit ff339da983
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      .github/workflows/publish-docker-image-every-push.yml
  2. 48
      .github/workflows/publish-docker-image-release.yml
  3. 1
      CHANGELOG.md
  4. 4
      docker/Dockerfile

@ -53,6 +53,8 @@ jobs:
context: .
file: ./docker/Dockerfile
push: true
cache-from: type=registry,ref=blockscout/blockscout:buildcache
cache-to: type=registry,ref=blockscout/blockscout:buildcache,mode=max
tags: blockscout/blockscout:latest, blockscout/blockscout:${{ env.NEXT_RELEASE_VERSION }}-prerelease-${{ env.SHORT_SHA }}
build-args: |
CACHE_EXCHANGE_RATES_PERIOD=

@ -42,27 +42,33 @@ jobs:
images: blockscout/blockscout
- name: Build & Push Docker image
run: |
docker buildx build \
-t blockscout/blockscout:latest \
-t blockscout/blockscout:${{ env.RELEASE_VERSION }} \
-f ./docker/Dockerfile \
--build-arg CACHE_EXCHANGE_RATES_PERIOD="" \
--build-arg DISABLE_READ_API="false" \
--build-arg API_PATH="/" \
--build-arg NETWORK_PATH="/" \
--build-arg DISABLE_WEBAPP="false" \
--build-arg DISABLE_WRITE_API="false" \
--build-arg CACHE_ENABLE_TOTAL_GAS_USAGE_COUNTER="" \
--build-arg WOBSERVER_ENABLED="false" \
--build-arg ADMIN_PANEL_ENABLED="" \
--build-arg CACHE_ADDRESS_WITH_BALANCES_UPDATE_INTERVAL="" \
--build-arg SOCKET_ROOT="" \
--build-arg CHAIN_ID="" \
--build-arg JSON_RPC="" \
--build-arg SUBNETWORK="" \
--build-arg COIN_NAME="" \
--push --platform=linux/arm64,linux/amd64 .
uses: docker/build-push-action@v3
with:
context: .
file: ./docker/Dockerfile
push: true
cache-from: type=registry,ref=blockscout/blockscout:buildcache
cache-to: type=registry,ref=blockscout/blockscout:buildcache,mode=max
tags: blockscout/blockscout:latest, blockscout/blockscout:${{ env.RELEASE_VERSION }}
platforms: |
linux/arm64
linux/amd64
build-args: |
CACHE_EXCHANGE_RATES_PERIOD=""
DISABLE_READ_API="false"
API_PATH="/"
NETWORK_PATH="/"
DISABLE_WEBAPP="false"
DISABLE_WRITE_API="false"
CACHE_ENABLE_TOTAL_GAS_USAGE_COUNTER=""
WOBSERVER_ENABLED="false"
ADMIN_PANEL_ENABLED=""
CACHE_ADDRESS_WITH_BALANCES_UPDATE_INTERVAL=""
SOCKET_ROOT=""
CHAIN_ID=""
JSON_RPC=""
SUBNETWORK=""
COIN_NAME=""
merge-master-after-release:
name: Merge 'master' to specific branch after release

@ -7,6 +7,7 @@
- [#5807](https://github.com/blockscout/blockscout/pull/5807) - Update Makefile migrate command due to release build
### Chore
- [#5861](https://github.com/blockscout/blockscout/pull/5861) - Add cache for docker build
- [#5859](https://github.com/blockscout/blockscout/pull/5859) - Update ex_cldr hex packages
- [#5858](https://github.com/blockscout/blockscout/pull/5858) - Update CHANGELOG; revert update of css-loader; rename fontawesome icons selectors
- [#5811](https://github.com/blockscout/blockscout/pull/5811) - Bump chartjs-adapter-luxon from 1.1.0 to 1.2.0 in /apps/block_scout_web/assets

@ -38,6 +38,7 @@ ARG CHAIN_ID
ARG JSON_RPC
ARG SUBNETWORK
ARG COIN_NAME
ARG COIN
# Cache elixir deps
ADD mix.exs mix.lock ./
@ -52,7 +53,6 @@ ADD . .
COPY . .
ARG COIN
RUN if [ "$COIN" != "" ]; then \
sed -i s/"POA"/"${COIN}"/g apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po; \
sed -i "/msgid \"Ether\"/{n;s/msgstr \"\"/msgstr \"${COIN}\"/g}" apps/block_scout_web/priv/gettext/default.pot; \
@ -86,5 +86,3 @@ WORKDIR /app
COPY --from=builder /opt/release/blockscout .
COPY --from=builder /app/apps/explorer/node_modules ./node_modules

Loading…
Cancel
Save