Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bfanodo
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Silvio Quadri
bfanodo
Commits
6eb17121
Commit
6eb17121
authored
5 years ago
by
Robert Martin-Legene
Browse files
Options
Downloads
Patches
Plain Diff
Import
parent
eafce4d2
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Dockerfile
+20
-0
20 additions, 0 deletions
Dockerfile
build.sh
+27
-0
27 additions, 0 deletions
build.sh
start.sh
+26
-0
26 additions, 0 deletions
start.sh
with
73 additions
and
0 deletions
Dockerfile
0 → 100644
+
20
−
0
View file @
6eb17121
FROM
ethereum/solc:0.5.10-alpine
AS
solc
FROM
ethereum/client-go:alltools-v1.9.2
LABEL
maintainer="Robert Martin-Legene <robert@nic.ar>"
HEALTHCHECK
--start-period=15s CMD [ "/usr/bin/nc", "-z", "-w", "2", "127.0.0.1", "8545" ]
CMD
[ "/home/bfa/bfa/bin/singlestart.sh" ]
COPY
--from=solc /usr/local/bin/solc /usr/local/bin
EXPOSE
8545 8546 30303
ENV
USERNAME=bfa HOME=/home/bfa
ENV
BFAHOME=${HOME}/bfa BFANETWORKIDPROD=47525974938 BFANETWORKIDTEST=55555000000 VIRTUALIZATION=DOCKER
ENV
BFANETWORKDIRPROD=${BFAHOME}/network BFANETWORKDIRTEST=${BFAHOME}/test2network PATH=${BFAHOME}/bin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
RUN
adduser
-u
30303
-s
/bin/bash
-h
${
HOME
}
-D
${
USERNAME
}
${
USERNAME
}
&&
apk add
--no-cache
git bash jq perl perl-class-accessor perl-json perl-json-xs perl-lwp-protocol-https nodejs npm binutils python3
&&
rm
-f
/var/cache/apk/
*
USER
${USERNAME}
WORKDIR
${HOME}
RUN
git clone
--quiet
https://gitlab.bfa.ar/blockchain/nucleo.git
${
BFAHOME
}
&&
cd
${
BFAHOME
}
&&
npm
install
--no-optional
&&
npm audit fix
ENV
BFANETWORKID=${BFANETWORKIDPROD} BFANETWORKDIR=${BFANETWORKDIRPROD}
ENV
BFANODEDIR=${BFANETWORKDIR}/node BFATOML=${BFANETWORKDIR}/config.toml
RUN
mkdir
-p
${
BFANODEDIR
}
&&
ln
-s
${
BFANODEDIR
}
.ethereum
RUN
sed
-i
's/^HTTPHost = "127.0.0.1"/HTTPHost = "0.0.0.0"/'
${
BFATOML
}
WORKDIR
${BFAHOME}
VOLUME
[ "/home/bfa" ]
This diff is collapsed.
Click to expand it.
build.sh
0 → 100755
+
27
−
0
View file @
6eb17121
#!/bin/bash
# 20190829 Robert Martin-Legene
# This builds the docker bfanode on a Debian host system.
# If on another distribution, maybe you need to find docker-squash with pip3
trap
"exit 1"
ERR
TAG
=
latest
DOCKERFILENAME
=
Dockerfile
if
[
"
$1
"
==
"test"
]
then
TAG
=
test
DOCKERFILENAME
=
Dockerfile-
${
TAG
}
sed
's/BFANETWORKID=..BFANETWORKIDPROD. BFANETWORKDIR=..BFANETWORKDIRPROD./BFANETWORKID=${BFANETWORKIDTEST} BFANETWORKDIR=${BFANETWORKDIRTEST}/'
< Dockerfile
>
${
DOCKERFILENAME
}
fi
docker build
-f
${
DOCKERFILENAME
}
-t
bfanode:
${
TAG
}
.
rm
-f
Dockerfile-test
||
true
docker tag bfanode:
${
TAG
}
rlegene/bfanode:
${
TAG
}
if
[
"
$USER
"
=
"robert"
]
then
read
-p
'Upload? : '
-n
1
echo
test
"
$REPLY
"
=
"y"
||
exit
0
docker push rlegene/bfanode:
${
TAG
}
||
(
echo
"Did you remember to log in using 'docker login'?"
;
false
)
## Some day maybe we will have our own working registry.
#docker tag bfanode:${TAG} registry.gitlab.bfa.ar:5005/blockchain/bfanode:${TAG}
#docker push registry.gitlab.bfa.ar:5005/blockchain/bfanode:${TAG} || ( echo "Did you remember to log in using 'docker login'?" ; false )
fi
This diff is collapsed.
Click to expand it.
start.sh
0 → 100755
+
26
−
0
View file @
6eb17121
#!/bin/bash
trap
'exit 1'
ERR
if
!
which docker
>
/dev/null 2>&1
then
echo
'Can not find Docker. Make sure it is installed.'
if
grep
-q
Debian /etc/issue
then
echo
Consider
echo
'echo deb "[arch=amd64] https://download.docker.com/linux/debian stretch stable" > /etc/apt/sources.list.d/docker.list'
echo
'apt update'
echo
'apt install docker-ce-cli'
if
grep
-vq
swapaccount
=
1 /etc/default/grub
then
echo
'Also, you should read https://docs.docker.com/install/linux/linux-postinstall/#your-kernel-does-not-support-cgroup-swap-limit-capabilities'
fi
fi
exit
1
fi
mkdir
-p
${
HOME
}
/dockers/volumes/bfanodo,home,bfa,bfa,network,node,geth
mounts
=
"-v
${
HOME
}
/dockers/volumes/bfanodo,home,bfa,bfa,network,node,geth:/home/bfa/bfa/network/node/geth"
docker run
--rm
$mounts
-u
root alpine
chown
-R
30303:30303 /home/bfa/bfa/network
docker run
-d
--memory
4g
$mounts
-p
127.0.0.1:8545:8545
-p
127.0.0.1:8546:8546
-p
30303:30303
--restart
=
unless-stopped
--name
bfanodo rlegene/bfanode
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment