LoginSignup
0
0

More than 3 years have passed since last update.

mongo-go-driverがうまく入らなかったので、手動でいれた。

Last updated at Posted at 2019-08-16

概要

mongo-go-driverをDockerfileなり、自動で入れようとしたら上手くいかず、手動でいれるとうまくいったので、その共有。
誰かが同じ轍を踏まないように。

mongo-go-driver

Go Runtimeコンテナ

base image => golang:1.12.8 ※2019/08/15時点でのstable version

アタッチして下記を実行

パッケージ管理ツール: depのインストール

$ curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh

Projectの初期化

$ dep init ※project rootで

Mongo Driverのインストール

$ dep ensure --add go.mongodb.org/mongo-driver/mongo go.mongodb.org/mongo-driver/bson go.mongodb.org/mongo-driver/mongo/options

※goファイルでimportしていない場合、「これはまだ仮のインストールでっせ」という警告が出るかもしれませんが、
importすれば、消えるので無視でOK

あとはdocker commitなりなんなり。

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0