Git Product home page Git Product logo

Comments (7)

beltran avatar beltran commented on June 3, 2024

pip list would indicate the gssapi python package is installed (https://pypi.org/project/gssapi/). But the gssapi c libraries could not be installed. If you can share the Dockerfile I wouldn't mind taking a closer a look.

from gohive.

beltran avatar beltran commented on June 3, 2024

Looks like the problem is with the go gasspi dependency, I'm not sure if the error is really indicating the c gssapi files are not installed, if you can get the whole list of errors that would be useful as well (since the error output ends with gssapi.go:198:126: too many errors). You can aslo try go get github.com/beltran/gssapi and see the errors with that command.

from gohive.

KaluTheKova avatar KaluTheKova commented on June 3, 2024

Running go get github.com/beltran/gssapi causes no errors.
Running go get -tags kerberos github.com/beltran/gssapi causes no errors.
Running go get github.com/beltran/gosasl outputs:

go: github.com/beltran/gosasl upgrade => v0.0.0-20200715011608-d5475aebb293
go: downloading github.com/beltran/gosasl v0.0.0-20200715011608-d5475aebb293

And is successful.

Running go get -tags kerberos github.com/beltran/gosasl outputs:

go: github.com/beltran/gosasl upgrade => v0.0.0-20200715011608-d5475aebb293
go: downloading github.com/beltran/gosasl v0.0.0-20200715011608-d5475aebb293
# github.com/beltran/gosasl
/go/pkg/mod/github.com/beltran/[email protected]/gssapi.go:62:16: undefined: gssapi.Name
/go/pkg/mod/github.com/beltran/[email protected]/gssapi.go:181:2: undefined: gssapi.Options
/go/pkg/mod/github.com/beltran/[email protected]/gssapi.go:183:2: undefined: gssapi.Lib
/go/pkg/mod/github.com/beltran/[email protected]/gssapi.go:187:18: undefined: gssapi.CredId
/go/pkg/mod/github.com/beltran/[email protected]/gssapi.go:190:18: undefined: gssapi.CtxId
/go/pkg/mod/github.com/beltran/[email protected]/gssapi.go:198:20: undefined: gssapi.GSS_C_INTEG_FLAG
/go/pkg/mod/github.com/beltran/[email protected]/gssapi.go:198:54: undefined: gssapi.GSS_C_MUTUAL_FLAG
/go/pkg/mod/github.com/beltran/[email protected]/gssapi.go:198:89: undefined: gssapi.GSS_C_SEQUENCE_FLAG
/go/pkg/mod/github.com/beltran/[email protected]/gssapi.go:198:126: undefined: gssapi.GSS_C_CONF_FLAG
/go/pkg/mod/github.com/beltran/[email protected]/gssapi.go:326:44: undefined: gssapi.Name
/go/pkg/mod/github.com/beltran/[email protected]/gssapi.go:198:126: too many errors

I honestly have no idea how I could make go show more errors during package install :(.

from gohive.

KaluTheKova avatar KaluTheKova commented on June 3, 2024

And here is the dockerfile I'm using.

FROM golang:1.15.2-buster AS builder

# Set necessary environmet variables needed for our image
ENV GO111MODULE=on \
    CGO_ENABLED=0 \
    GOOS=linux \
    GOARCH=amd64 \ 
    GOPROXY="SANITIZED"

# Move to working directory /build
WORKDIR /build

# Copy and download dependency using go mod
COPY go.mod .
COPY go.sum .
RUN go mod download

ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends apt-utils
RUN apt-get install python-pip libkrb5-dev -y
RUN pip install gssapi
RUN pip list

RUN go install -tags kerberos "github.com/beltran/gohive"

# Copy the code into the container
COPY . .

# Build the binary
RUN go build -o main .

# Move to /bin for the resulting binary file
WORKDIR /bin

# Copy binary from build to main folder
RUN cp /build/main .

COPY . .

# Start from scratch
FROM scratch

# Copy the binary
COPY --from=builder /bin/main /

# Add user
USER 1000

# Command to run
ENTRYPOINT [ "/main" ]

from gohive.

beltran avatar beltran commented on June 3, 2024

I'm not sure why but I believe this is caused by setting CGO_ENABLED=0, it works I think with CGO_ENABLED=1, do you need to set this to zero?

from gohive.

KaluTheKova avatar KaluTheKova commented on June 3, 2024

You are correct, that solves it! Thank you very much.

from gohive.

beltran avatar beltran commented on June 3, 2024

Happy to help, closing this for now

from gohive.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.