Skip to content

Commit

Permalink
Added cache for Docker build process
Browse files Browse the repository at this point in the history
  • Loading branch information
bsrinivas8687 committed Mar 12, 2023
1 parent 3b7c9c4 commit 7c96b91
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ jobs:
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
cache-from: type=gha
cache-to: mode=max,type=gha
context: .
platforms: linux/amd64,linux/arm64
push: true
Expand Down
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ FROM golang:1.20-alpine3.17 AS build

COPY . /root/dvpn-node/

RUN apk add autoconf automake bash file g++ gcc git libtool linux-headers make musl-dev unbound-dev && \
RUN --mount=target=/go/pkg/mod,type=cache \
--mount=target=/root/.cache/go-build,type=cache \
apk add autoconf automake bash file g++ gcc git libtool linux-headers make musl-dev unbound-dev && \
cd /root/dvpn-node/ && make --jobs=$(nproc) install && \
git clone --branch=master --depth=1 https://github.com/handshake-org/hnsd.git /root/hnsd && \
cd /root/hnsd/ && bash autogen.sh && sh configure && make --jobs=$(nproc)
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ install:

.PHONY: build-image
build-image:
@docker build --compress --file Dockerfile --force-rm --no-cache --tag sentinel-dvpn-node .
@docker build --compress --file Dockerfile --force-rm --tag sentinel-dvpn-node .

.PHONY: go-lint
go-lint:
Expand Down

0 comments on commit 7c96b91

Please sign in to comment.