Giter Site home page Giter Site logo

Build Docker image about cgofuse HOT 2 CLOSED

winfsp avatar winfsp commented on May 21, 2024
Build Docker image

from cgofuse.

Comments (2)

billziss-gh avatar billziss-gh commented on May 21, 2024

It is not clear to me what you are asking.

If you are looking for cross-compilation builds it is best to use xgo as documented here.

If you are looking to create your own Docker image to build cgofuse based projects then you need to install the prerequisites and then build as documented here.

from cgofuse.

tomcat-bit avatar tomcat-bit commented on May 21, 2024

To explain better -- I'm using the current Docker file

FROM golang:alpine AS builder
ENV GOBIN $GOPATH/bin
RUN apk update
RUN apk add fuse-dev gcc libc-dev fuse

# Set necessary environmet variables needed for our image
ENV GO111MODULE=auto \
    CGO_ENABLED=0 \
    GOOS=linux \
    GOARCH=amd64

RUN mkdir -p /go/src/github.com/tomcat-bit/cgofuse
WORKDIR /go/src/github.com/tomcat-bit/cgofuse

COPY go.mod .
COPY go.sum .
RUN go mod download 

COPY . .

RUN go build -a -o /fuser ./examples/passthrough
FROM alpine:latest

RUN apk update
RUN apk add fuse
COPY --from=builder /fuser /

I get

/go/pkg/mod/github.com/billziss-gh/[email protected]/fuse/host.go:30:8: undefined: c_struct_fuse
/go/pkg/mod/github.com/billziss-gh/[email protected]/fuse/host.go:64:38: undefined: c_fuse_statvfs_t
/go/pkg/mod/github.com/billziss-gh/[email protected]/fuse/host.go:79:33: undefined: c_fuse_stat_t
/go/pkg/mod/github.com/billziss-gh/[email protected]/fuse/host.go:98:56: undefined: c_fuse_timespec_t
/go/pkg/mod/github.com/billziss-gh/[email protected]/fuse/host.go:103:28: undefined: c_int
/go/pkg/mod/github.com/billziss-gh/[email protected]/fuse/host.go:114:25: undefined: c_char
/go/pkg/mod/github.com/billziss-gh/[email protected]/fuse/host.go:114:40: undefined: c_fuse_stat_t
/go/pkg/mod/github.com/billziss-gh/[email protected]/fuse/host.go:114:62: undefined: c_int
/go/pkg/mod/github.com/billziss-gh/[email protected]/fuse/host.go:124:26: undefined: c_char
/go/pkg/mod/github.com/billziss-gh/[email protected]/fuse/host.go:124:55: undefined: c_size_t

It seems like using Go mod doesn't work with building with fuse. Further, using dep as described in andersjohansenange@a08ea76 works fine. When it works, I'll probably make a pull request on how to build a Docker image when Go modules is enabled.

from cgofuse.

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.