-
Notifications
You must be signed in to change notification settings - Fork 1k
[**Added**] Build neo-cli Docker Image
#3355
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
Merged
NGDAdmin
merged 26 commits into
neo-project:master
from
cschuchardt88:add/tests/devcontainer-workflow
Jul 23, 2024
Merged
Changes from 20 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
6e47778
Added `devcontrainer` test for `neo-cli`
cschuchardt88 ddc33da
Basic contrainer setup
cschuchardt88 c23f15b
Updated version of `checkout` action job's step.
cschuchardt88 9f62660
Changed to `neo-cli`
cschuchardt88 1b06cc1
Update `dockerfile`
cschuchardt88 058d16a
Updated `PostCreateCommand`
cschuchardt88 6be5733
Changed to `bookworm-slim`
cschuchardt88 0ce7674
Reverted to `Jammy`
cschuchardt88 41ad46e
Added `sudo` command for `PostCreateCommand`
cschuchardt88 66e3b34
Added permissions
cschuchardt88 5707d39
Removed `screen` command
cschuchardt88 299973b
Added to `bin` and `PostCreateCommand`
cschuchardt88 5e54cf1
Changed `devcontainer` files
cschuchardt88 3ec9f3b
Reverted builds
cschuchardt88 02f6229
Added `neo` repo to devcontainer
cschuchardt88 85cf83e
Changed to docker-image for github registry
cschuchardt88 34cb95f
Fixed Bugs in `docker` support for `neo-cli` image
cschuchardt88 a07c619
Added type `container`
cschuchardt88 e3fbfbd
Revert `.devcontainer` folder
cschuchardt88 48ddb3c
format
cschuchardt88 57233d2
Changed workflow to `docker` for `pkgs-delete.yml` since we use `v4`
cschuchardt88 b877de0
Deleted `Dockerfile` from `src\Neo.CLI`
cschuchardt88 8821807
Merge branch 'master' into add/tests/devcontainer-workflow
cschuchardt88 b7c941c
Revert "Deleted `Dockerfile` from `src\Neo.CLI`"
cschuchardt88 5a18caa
Merge branch 'master' into add/tests/devcontainer-workflow
e960297
Merge branch 'master' into add/tests/devcontainer-workflow
cschuchardt88 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,77 @@ | ||
| name: Publish (docker-image) | ||
|
|
||
| on: | ||
| release: | ||
| types: [published] | ||
|
|
||
| env: | ||
| DOTNET_VERSION: 8.0.x | ||
| DIST_DIR: ./dist | ||
|
|
||
| jobs: | ||
| neo-cli-build: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Set Application Version (Environment Variable) | ||
| run: | | ||
| APP_VERSION=$(echo '${{ github.event.release.tag_name }}' | cut -d 'v' -f 2) | ||
| echo "APP_VERSION=$APP_VERSION" >> $GITHUB_ENV | ||
|
|
||
| - name: Checkout (GitHub) | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup .NET | ||
| uses: actions/setup-dotnet@v4 | ||
| with: | ||
| dotnet-version: ${{ env.DOTNET_VERSION }} | ||
|
|
||
| - name: Build (neo-cli) | ||
| run: | | ||
| dotnet publish ./src/Neo.CLI \ | ||
| --framework net8.0 \ | ||
| --configuration Release \ | ||
| --runtime linux-x64 \ | ||
| --self-contained true \ | ||
| --output ${{ env.DIST_DIR }} \ | ||
| --verbosity normal \ | ||
| -p:VersionPrefix=${{ env.APP_VERSION }} \ | ||
| -p:RuntimeIdentifier=linux-x64 \ | ||
| -p:SelfContained=true \ | ||
| -p:IncludeNativeLibrariesForSelfExtract=false \ | ||
| -p:PublishTrimmed=false \ | ||
| -p:PublishSingleFile=true \ | ||
| -p:PublishReadyToRun=true \ | ||
| -p:EnableCompressionInSingleFile=true \ | ||
| -p:DebugType=embedded \ | ||
| -p:ServerGarbageCollection=true | ||
|
|
||
| - name: Build (LevelDbStore) | ||
| run: | | ||
| dotnet build ./src/Plugins/LevelDBStore \ | ||
| --framework net8.0 \ | ||
| --configuration Release \ | ||
| --output ${{ env.DIST_DIR }}/Plugins/LevelDBStore \ | ||
| --verbosity normal \ | ||
| -p:VersionPrefix=${{ env.APP_VERSION }} | ||
|
|
||
| - name: Remove (junk) | ||
| run: | | ||
| rm -v ${{ env.DIST_DIR }}/Plugins/LevelDBStore/Neo* | ||
| rm -v ${{ env.DIST_DIR }}/Plugins/LevelDBStore/*.pdb | ||
| rm -v ${{ env.DIST_DIR }}/Plugins/LevelDBStore/*.xml | ||
| rm -v ${{ env.DIST_DIR }}/*.xml | ||
|
|
||
| - name: Docker Login | ||
| run: | | ||
| docker login ghcr.io \ | ||
| --username ${{ github.repository_owner }} \ | ||
| --password ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Docker Build | ||
| run: | | ||
| docker build . \ | ||
| --file ./.neo/docker/neo-cli/Dockerfile \ | ||
| --tag ghcr.io/${{ github.repository_owner }}/neo-cli:latest \ | ||
| --tag ghcr.io/${{ github.repository_owner }}/neo-cli:${{ env.APP_VERSION }} \ | ||
| --push |
This file contains hidden or 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 hidden or 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,8 @@ | ||
| FROM debian:stable-slim | ||
|
|
||
| # Install the apt-get packages | ||
| RUN apt-get update | ||
| RUN apt-get install -y libicu-dev libleveldb-dev screen | ||
|
|
||
| COPY ./dist /opt/neo-cli | ||
| RUN ln -s /opt/neo-cli/neo-cli /usr/bin | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.