-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #524 from protofire/add-docker-image
Add docker image
- Loading branch information
Showing
5 changed files
with
67 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Docker Image CI | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'solhint version' | ||
required: true | ||
image_name: | ||
description: 'Name of image to be used on docker hub' | ||
required: true | ||
default: 'protofire/solhint' | ||
jobs: | ||
|
||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Login to Docker Hub | ||
run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_ACCESS_TOKEN }} | ||
|
||
- name: Build Docker image | ||
run: docker build . --file docker/Dockerfile --tag ${{ inputs.image_name }}:${{ inputs.version }} --build-arg VERSION=${{ inputs.version }} | ||
|
||
- name: Push Docker image to Docker Hub | ||
run: docker push ${{ inputs.image_name }}:${{ inputs.version }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,6 @@ antlr4.jar | |
/docs/.sass-cache/ | ||
_temp/ | ||
*solhintReport*.* | ||
.env | ||
**/.DS_Store | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FROM node:20-alpine | ||
LABEL maintainer="[email protected]" | ||
ENV VERSION=4.0.0 | ||
|
||
RUN npm install -g solhint@"$VERSION" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Docker Instructions | ||
Thanks [@keypee](https://github.com/kaypee90) for the contribution<br><br> | ||
|
||
1. Get the image. Run:<br> | ||
`docker pull protodb/protofire-solhint:latest` | ||
|
||
2. Check if image is present (protodb/protofire-solhint:latest)<br> | ||
`docker images` | ||
|
||
3. Solhint use:<br> | ||
|
||
- Execute solhint with default config file<br> | ||
`docker run -v ./:/app -w /app -it protodb/protofire-solhint solhint './contracts/*.sol'` | ||
|
||
This command:<br> | ||
- Maps current folder to app/ inside container <br> | ||
- Executes solhint in './contracts/*.sol'<br> | ||
|
||
- Navigate inside container sharing current folder into app/ container folder<br> | ||
`docker run -v ./:/app -w /app -it protodb/protofire-solhint /bin/sh`<br> | ||
|
||
This command:<br> | ||
- Maps current folder to app/ container folder<br> | ||
- Can run solhint inside the container by typping `solhint ./contracts/*.sol`<br> | ||
(use your correct path, type exit to finish)<br> | ||
|
||
|