Skip to content

The env setting does NOT work in docker file? #50

Closed
@ZacZelner

Description

@ZacZelner

Hi, I am using dockerfile to build one application using go_ibm_db.

The application works well in my local mac, and I am using:
export DB2HOME=/Users/zac/go/src/github.com/ibmdb/go_ibm_db/installer/clidriver
export CGO_CFLAGS=-I$DB2HOME/include
export DYLD_LIBRARY_PATH=$DB2HOME/lib
export CGO_LDFLAGS=-L$DB2HOME/lib

however, I set these env in the dockerfile, and can not work well.
dockerfile:
ENV DB2HOME=/Users/zac/go/src/github.com/ibmdb/go_ibm_db/installer/clidriver
ENV CGO_CFLAGS=-I$DB2HOME/include
ENV DYLD_LIBRARY_PATH=$DB2HOME/lib
ENV CGO_LDFLAGS=-L$DB2HOME/lib

I print these env values out before I run the application in the dock images.
cd /go/src/demowithJS

echo $DB2HOME
echo $CGO_CFLAGS
echo $DYLD_LIBRARY_PATH
echo $CGO_LDFLAGS

bee run

There is the error:
zac$ docker run -it -p 8081:8081 ocvtest
/Users/zac/go/src/github.com/ibmdb/go_ibm_db/installer/clidriver
-I/Users/zac/go/src/github.com/ibmdb/go_ibm_db/installer/clidriver/include
/Users/zac/go/src/github.com/ibmdb/go_ibm_db/installer/clidriver/lib
-L/Users/zac/go/src/github.com/ibmdb/go_ibm_db/installer/clidriver/lib


| ___
| |/ / ___ ___
| ___ \ / _ \ / _
| |
/ /| /| /
_
/ _
| __| v1.10.0
2019/12/10 02:16:52 INFO ▶ 0001 Using 'demowithJS' as 'appname'
2019/12/10 02:16:52 INFO ▶ 0002 Initializing watcher...
github.com/ibmdb/go_ibm_db/api
github.com/astaxie/beego/config
github.com/astaxie/beego/utils
github.com/astaxie/beego/vendor/gopkg.in/yaml.v2

github.com/ibmdb/go_ibm_db/api

../github.com/ibmdb/go_ibm_db/api/api_unix.go:12:11: fatal error: sqlcli1.h: No such file or directory
// #include <sqlcli1.h>
^~~~~~~~~~~
compilation terminated.

Please help us, thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions