Skip to content

Commit

Permalink
Merge pull request ava-labs#378 from ava-labs/docker-ignore
Browse files Browse the repository at this point in the history
Add dockerignore
  • Loading branch information
StephenButtolph authored Apr 7, 2021
2 parents d99e61f + 9b11f4a commit 55d523e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
10 changes: 10 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.ci
.git
.github
.gitignore
.golangci.yml
.idea
.vscode

LICENSE
*.md
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
# syntax=docker/dockerfile:experimental

ARG AVALANCHEGO_COMMIT
FROM golang:1.15.5-buster

ARG AVALANCHEGO_COMMIT

RUN mkdir -p /go/src/github.com/ava-labs

WORKDIR $GOPATH/src/github.com/ava-labs/
COPY . avalanchego

WORKDIR $GOPATH/src/github.com/ava-labs/avalanchego
RUN export AVALANCHEGO_COMMIT=$AVALANCHEGO_COMMIT
RUN ./scripts/build.sh

RUN ln -sv $GOPATH/src/github.com/ava-labs/avalanchego/ /avalanchego
2 changes: 1 addition & 1 deletion scripts/build_avalanche.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ GOPATH="$(go env GOPATH)"
AVALANCHE_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd .. && pwd ) # Directory above this script
BUILD_DIR=$AVALANCHE_PATH/build # Where binaries go

GIT_COMMIT=$( git rev-list -1 HEAD )
GIT_COMMIT=${AVALANCHEGO_COMMIT:-$( git rev-list -1 HEAD )}

# Build aVALANCHE
echo "Building Avalanche..."
Expand Down
2 changes: 1 addition & 1 deletion scripts/build_local_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ FULL_COMMIT_HASH="$(git --git-dir="$AVALANCHE_PATH/.git" rev-parse HEAD)"
COMMIT_HASH="${FULL_COMMIT_HASH::8}"

echo "Building Docker Image: $DOCKERHUB_REPO:$COMMIT_HASH"
docker build -t "$DOCKERHUB_REPO:$COMMIT_HASH" "$AVALANCHE_PATH" -f "$AVALANCHE_PATH/Dockerfile"
docker build -t "$DOCKERHUB_REPO:$COMMIT_HASH" "$AVALANCHE_PATH" -f "$AVALANCHE_PATH/Dockerfile" --build-arg AVALANCHEGO_COMMIT="$FULL_COMMIT_HASH"

0 comments on commit 55d523e

Please sign in to comment.