Moving to a single indra executable.

This commit is contained in:
Colin Lyons
2022-12-22 16:51:06 +00:00
parent d8315e9e31
commit 5730c0ef00
4 changed files with 16 additions and 21 deletions

View File

@@ -1,5 +0,0 @@
package main
func main() {
}

View File

@@ -15,7 +15,7 @@ var (
log = log2.GetLogger(indra.PathBase) log = log2.GetLogger(indra.PathBase)
check = log.E.Chk check = log.E.Chk
commands = &cmds.Command{ commands = &cmds.Command{
Name: "ind", Name: "indra",
Description: "The indra network daemon.", Description: "The indra network daemon.",
Documentation: lorem, Documentation: lorem,
Entrypoint: func(c *cmds.Command, args []string) error { Entrypoint: func(c *cmds.Command, args []string) error {
@@ -35,7 +35,7 @@ var (
Commands: cmds.Commands{ Commands: cmds.Commands{
{ {
Name: "version", Name: "version",
Description: "print ind version", Description: "print indra version",
Documentation: lorem, Documentation: lorem,
Entrypoint: func(c *cmds.Command, args []string) error { Entrypoint: func(c *cmds.Command, args []string) error {

View File

@@ -2,20 +2,20 @@
FROM golang:1.19.4 AS builder FROM golang:1.19.4 AS builder
# User/Group definition # User/Group definition
ENV USER=ind UID=8337 GID=8337 ENV USER=indra GROUP=indra UID=8337 GID=8337
# Create a user/group for ind, to be migrated to the target container # Create a user/group for indra, to be migrated to the target container
RUN addgroup "ind" --gid ${GID} \ RUN addgroup ${GROUP} --gid ${GID} \
&& adduser \ && adduser \
--disabled-password \ --disabled-password \
--gecos "" \ --gecos "" \
--home "/var/ind" \ --home "/var/indra" \
--shell "/sbin/nologin" \ --shell "/sbin/nologin" \
#--no-create-home \ #--no-create-home \
--uid "${UID}" \ --uid "${UID}" \
--gid "${GID}" \ --gid "${GID}" \
"${USER}" \ "${USER}" \
&& mkdir -pv /var/ind/.ind && chown -R ind:ind /var/ind && mkdir -pv /var/indra/.indra && chown -R indra:indra /var/indra
# Source/Target build defaults # Source/Target build defaults
ARG ARCH=amd64 ARG ARCH=amd64
@@ -30,9 +30,9 @@ RUN set -ex \
# && if [ "${ARCH}" = "amd64" ]; then export GOARCH=amd64; fi \ # && if [ "${ARCH}" = "amd64" ]; then export GOARCH=amd64; fi \
# && if [ "${ARCH}" = "arm32v7" ]; then export GOARCH=arm; fi \ # && if [ "${ARCH}" = "arm32v7" ]; then export GOARCH=arm; fi \
# && if [ "${ARCH}" = "arm64v8" ]; then export GOARCH=arm64; fi \ # && if [ "${ARCH}" = "arm64v8" ]; then export GOARCH=arm64; fi \
&& go install -v ./cmd/ind/main.go \ && go install -v ./cmd/indra/main.go \
&& mkdir -pv /build/bin \ && mkdir -pv /build/bin \
&& CGO_ENABLED=0 go build --ldflags '-w -s' -o /build/bin/ind ./cmd/ind/. && CGO_ENABLED=0 go build --ldflags '-w -s' -o /build/bin/indra ./cmd/indra/.
# --- # ---
# Configure and Build the target container # Configure and Build the target container
@@ -46,19 +46,19 @@ COPY --from=builder /etc/group /etc/group
# Migrate the binaries # Migrate the binaries
COPY --from=builder /build/bin /bin COPY --from=builder /build/bin /bin
COPY --from=builder /var/ind /var/ind COPY --from=builder /var/indra /var/indra
# Enable the btcd user # Enable the btcd user
USER ind:ind USER indra:indra
# ENV defaults # ENV defaults
# ENV IND_LOGFILEPATH="" # ENV IND_LOGFILEPATH=""
# Set the data volume # Set the data volume
#VOLUME ["/ind"] #VOLUME ["/indra"]
# :8337 ind peer-to-peer port # :8337 indra peer-to-peer port
# :8338 ind RPC port # :8338 indra RPC port
EXPOSE 8337 8338 EXPOSE 8337 8338
ENTRYPOINT ["/bin/ind"] ENTRYPOINT ["/bin/indra"]

View File

@@ -11,7 +11,7 @@ var (
// URL is the git URL for the repository. // URL is the git URL for the repository.
URL = "github.com/Indra-Labs/indra" URL = "github.com/Indra-Labs/indra"
// GitRef is the gitref, as in refs/heads/branchname. // GitRef is the gitref, as in refs/heads/branchname.
GitRef = "refs/heads/ind-bootstrap" GitRef = "refs/heads/indra-bootstrap"
// ParentGitCommit is the commit hash of the parent HEAD. // ParentGitCommit is the commit hash of the parent HEAD.
ParentGitCommit = "8c361507bd145da860c9753d1dfb8951223ffc39" ParentGitCommit = "8c361507bd145da860c9753d1dfb8951223ffc39"
// BuildTime stores the time when the current binary was built. // BuildTime stores the time when the current binary was built.