第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

GoLang postgres testcontainer 將 BindMounts

GoLang postgres testcontainer 將 BindMounts

Go
紅糖糍粑 2022-12-13 10:52:47
我剛剛將測(cè)試容器庫從升級(jí)github.com/testcontainers/testcontainers-go v0.12.0到github.com/testcontainers/testcontainers-go v0.13.0 以前這是我創(chuàng)建請(qǐng)求的方式    ContainerRequest: testcontainers.ContainerRequest{            Image:          mountebankImage,            Name:           uuid.New().String(),            ExposedPorts:   []string{mountebankExposedPort},            BindMounts:     map[string]string{"/mountebank": path.Join(c.rootDir, "/test/stubs/mountebank")},            Entrypoint:     []string{"mb", "start", "--configfile", "/mountebank/imposters.ejs"},            Networks:       []string{c.network.Name},   在最新版本的測(cè)試容器庫中,BindMounts(不再支持鏈接)被 Mounts 取代。嘗試在我的初始化腳本中替換相同的內(nèi)容,但找不到它。BindMounts:     map[string]string{"/mountebank": path.Join(c.rootDir, "/test/stubs/mountebank")},它是請(qǐng)求正文的一部分。試過 testcontainers.ContainerMounts{}等我錯(cuò)過了什么嗎?
查看完整描述

1 回答

?
慕慕森

TA貢獻(xiàn)1856條經(jīng)驗(yàn) 獲得超17個(gè)贊

ContainerRequest對(duì)象包含一個(gè)對(duì)象列表ContainerMount,其中記錄了

Source 通常是 GenericBindMountSource 或 GenericVolumeMountSource

GenericBindMountSource只是命名一個(gè)主機(jī)路徑。DockerBindMountSource如果您需要高級(jí)選項(xiàng),也可以使用 a 。

所以你應(yīng)該能夠BindMounts:Mounts:

ContainerRequest: testcontainers.ContainerRequest{

        Mounts: testcontainers.Mounts(testcontainers.ContainerMount{

                Source: testcontainers.GenericBindMountSource{

                        HostPath: path.Join(c.rootDir, "/test/stubs/mountebank"),

                },

                Target: testcontainers.ContainerMountTarget("/mountebank"),

        }),

        ...

},


查看完整回答
反對(duì) 回復(fù) 2022-12-13
  • 1 回答
  • 0 關(guān)注
  • 115 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)