Skip to content

add AVALANCHEGO_VERSION dockerfile arg #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
# Use a base image that includes both Go and Node.js, such as the official Go image
FROM golang:latest

# Derived from ./devcontainer.json
ARG AVALANCHEGO_VERSION

ENV GOPATH=/go
ENV PATH=$PATH:$GOPATH/bin
ENV AVALANCHEGO_EXEC_PATH=$GOPATH/src/github.com/ava-labs/avalanchego/build/avalanchego
ENV AVALANCHEGO_PLUGIN_PATH=$GOPATH/src/github.com/ava-labs/avalanchego/build/plugins

# Install Node.js and npm using the official Node.js image
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && apt-get install -y nodejs

# Clone the avalanchego repository
RUN git clone -b v1.10.5 https://github.com/ava-labs/avalanchego.git $GOPATH/src/github.com/ava-labs/avalanchego
WORKDIR /

# Set the working directory to the cloned repository
WORKDIR $GOPATH/src/github.com/ava-labs/avalanchego
# # Download AvalancheGo Binary
RUN curl -LJO https://github.com/ava-labs/avalanchego/releases/download/v1.10.5/avalanchego-linux-amd64-v1.10.5.tar.gz
RUN tar -xzf avalanchego-linux-amd64-v1.10.5.tar.gz
RUN mv avalanchego-v1.10.5 avalanchego

# Build the avalanchego project using the sh script
RUN ./scripts/build.sh
ENV AVALANCHEGO_EXEC_PATH=/avalanchego/avalanchego

# Install Avalanche Network Runner
RUN curl -sSfL https://raw.githubusercontent.com/ava-labs/avalanche-network-runner/main/scripts/install.sh | sh -s

ENV PATH ~/bin:$PATH
5 changes: 4 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
"name": "Avalanche-DevContainer",

"build": {
"dockerfile": "Dockerfile"
"dockerfile": "Dockerfile",
"args": {
"AVALANCHEGO_VERSION": "v1.10.5"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there anyway we can derive this from https://github.com/ava-labs/precompile-evm/blob/main/scripts/versions.sh?. I.e by running the script when building the dockerfile?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ceyonur We're working on this

}
},
"runArgs": ["--network=host"],

Expand Down