title: What package should I install instead of libpcre++-dev to use C code in Alpine Golang?
body: <p>I have a Golang program inside a docker container (I use Ubuntu 18). Also I use <a href="http://github.com/glenn-brown/golang-pkg-pcre/src/pkg/pcre" rel="nofollow noreferrer">github.com/glenn-brown/golang-pkg-pcre/src/pkg/pcre</a> for regex in my Golang app. Before using this library I should install <code>libpcre++-dev</code> this way:</p>
  
  <blockquote>
    <p>sudo apt-get install libpcre++-dev</p>
  </blockquote>
  
  <p>But I use golang:alpine in my Dockerfile and this is no <code>libpcre++-dev</code> library in alpine packages.</p>
  
  <p><strong>What package should I install instead of</strong> <code>libpcre++-dev</code>?</p>
  
  <p>p.s. I have tried to install <code>libc6-compat</code>, <code>pcre pcre-dev</code>, <code>libpcrecpp</code> but I see this error:</p>
  
  <blockquote>
    <p>github.com/glenn-brown/golang-pkg-pcre/src/pkg/pcre
    /go/pkg/mod/github.com/glenn-brown/golang-pkg-pcre@v0.0.0-20120522223659-48bb82a8b8ce/src/pkg/pcre/pcre.go:52:10:
    fatal error: pcre.h: No such file or directory  #include 
              ^~~~~~~~ compilation terminated</p>
  </blockquote>
  
  <p>My Dockerfile:</p>
  
  <pre><code>FROM golang:alpine
  
  RUN apk update
  RUN apk upgrade
  RUN apk add --update --no-cache build-base gcc g++ pcre pcre-dev libc6-compat
  
  # Install git + SSL ca certificates.
  # Git is required for fetching the dependencies.
  # Ca-certificates is required to call HTTPS endpoints.
  RUN apk update &amp;&amp; apk add --no-cache curl git ca-certificates tzdata \
   &amp;&amp; update-ca-certificates 2&gt; /dev/null || true
  </code></pre>
  
  <p>I build my app this way:</p>
  
  <pre><code>- CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -ldflags="-w -s" -o bin/backend ./cmd/backend/main.go
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <p>I have change my Dockerfile (add line below)</p>
  
  <p><code>RUN apk add --update --no-cache build-base gcc g++ pcre pcre-dev libc6-compat</code></p>
  
  <p>And now I have a new error:</p>
  
  <blockquote>
    <p>Error loading shared library libpcre.so.1: No such file or directory
    (needed by /bin/backend)</p>
  </blockquote>