Comments (8)
I just tried a basic example with the same Dockerfile and there are no issues.
So, I copied the example from README, test.pdf, I did go mod init example
, then docker build --no-cache -t example
and docker run -it example:latest
, I also added some time.Sleep, so I can check with docker exec that files are created in /tmp/fitz*.
from go-fitz.
You don't need to install all those libraries if you are not building with extlib
, just -tags musl
is enough. So either don't install libraries or build with extlib
, but in that case, you need 1.20.0 installed as there have been some changes.
See here for a minimal docker #35 (comment)
from go-fitz.
@gen2brain thanks for the quick response,
Tried this
FROM golang:alpine
WORKDIR /app
RUN apk add --no-cache git gcc musl-dev
COPY go.mod go.sum ./
COPY example.go test.pdf ./
RUN go mod download
RUN go build -tags musl -o /example
CMD [ "/example" ]
build was successful
But still getting this error âŦī¸
cannot create context: incompatible header (1.20.0) and library (1.18.0) versions
2022/06/26 09:25:35 fitz: cannot create context
from go-fitz.
Do you have any idea about cause of the issue?
This comes when it tries to read the PDF
cannot create context: incompatible header (1.20.0) and library (1.18.0) versions
2022/06/26 09:25:35 fitz: cannot create context
from go-fitz.
Well, besides checking your go.mod file, or building a docker image without using the cache, no idea. Can you try the exact steps I did, does it work then?
from go-fitz.
I followed the exact steps. But it didn't worked
This is my go.mod
module pdf-transcoder
go 1.17
require (
github.com/aws/aws-sdk-go-v2 v1.16.5
github.com/aws/aws-sdk-go-v2/config v1.15.11
github.com/aws/aws-sdk-go-v2/service/s3 v1.26.11
github.com/confluentinc/confluent-kafka-go v1.8.2
github.com/gen2brain/go-fitz v1.20.0
github.com/matoous/go-nanoid/v2 v2.0.0
)
require (
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.2 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.12.6 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.6 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.12 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.6 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.13 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.3 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.2 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.7 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.6 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.6 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.11.9 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.16.7 // indirect
github.com/aws/smithy-go v1.11.3 // indirect
)
I am also building image using --no-cache
flag
from go-fitz.
@Ashutosh00710
I have the same problem in v1.20.2 version, did you solve it?please
from go-fitz.
@helios741 This dockerfile worked for me.
FROM golang:alpine
WORKDIR /app
RUN apk add --no-cache git gcc musl-dev
COPY . .
RUN go mod download
RUN go build -tags musl -o /example
CMD [ "/example" ]
with
- go-fitz (v
1.20.0
)
from go-fitz.
Related Issues (20)
- Error: ./PDFToImg.go:21:19: undefined: fitz.New HOT 3
- error: cannot find builtin CJK font HOT 3
- can build in mips arch? HOT 3
- Docker golang:alpine "cannot find -lmupdf_linux_arm64_musl: No such file or directory" HOT 1
- go mod vendor local vendor dir not include libs dir and include dir HOT 2
- system crash when converting page to image HOT 9
- error: cannot find builtin CJK font HOT 2
- outline.page.page undefined (type _Ctype_int has no field or method page) compiler (MissingFieldOrMethod) HOT 6
- libmupdf_linux_amd64.a error HOT 8
- Implement Text Extraction in PyMuPdf Fitz Layout Mode HOT 4
- how to build mupdf static library in window platform HOT 10
- cannot find builtin CJK font HOT 1
- doc.HTML() can it support <table> <tr> <td>? HOT 1
- linux compilation error HOT 3
- linux ubuntu build fail HOT 5
- Makes discord/lilliput segfault HOT 2
- fitz is empty HOT 2
- How to build docker with this package?
- GCC 12.2 Support HOT 10
- Is it possible to add PDF splitting and merging functions? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
đ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google â¤ī¸ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-fitz.