bio-routing / bio-rd Goto Github PK
View Code? Open in Web Editor NEWbio routing is a project to create a versatile, fast and reliable routing daemon in Golang. bio = BGP + IS-IS + OSPF
License: Apache License 2.0
bio routing is a project to create a versatile, fast and reliable routing daemon in Golang. bio = BGP + IS-IS + OSPF
License: Apache License 2.0
Currently, Go ecosystem believes the last version is v0.0.3-pre9: see https://pkg.go.dev/github.com/bio-routing/[email protected]/protocols/bgp/server?tab=versions. There should be a dot after pre
: v0.0.3-pre.18. But then, I think that it will be ordered before pre9
. Maybe just bump to 0.0.4?
When using bio-rd as a library, this is not possible to override the global logrus logger (well it is, as long as you only have one dependency using logrus, but that's not super clean). Instead, each component should use its own logger. bgp/server.Router
already has its own logger, but it is not user-settable.
I would propose to add a Logger
field to each structure needed it. It will be set to log.New()
by default or inherited if it is sensible. As long as the "New" methods don't try to log, this should work good enough. This does not require modifying any signature.
I can do the work if it is deemed acceptable. More complex alternatives would be to define a logging interface to avoid depending on logrus, but I don't need that myself and this is far more work.
We should consider using OpenCensus. So we get the abstraction layer for free.
Describe the feature
Currently Bio collects a lot of metrics on different sub-systems (BGP, BMP, VRFs) and all metrics are enabled by default. It would be nice if a BGP/BMP server, could be configured to emit only desired metrics, ideally having some presets but also allowing to configure this individually.
Use cases / additional context
Usually it's better to have than to be in need, however at scale a lot of metrics can easily become an issue, for example when using Bio as a BMP receiver for a large number of routers having a lot of peer and/or full tables. In this case it would be particularly neat to be able to disable some metrics, which are less relevant (e.g. some of the BMP message type counters, etc.).
Currently the daemon does not support MP-BGP thus sessions with exabgp and the like are not exchanging routes.
11:44:22 | 50889 | outgoing-1 | --------------------------------------------------------------------
11:44:22 | 50889 | outgoing-1 | the connection can not carry the following family/families
11:44:22 | 50889 | outgoing-1 | - peer is not configured for ipv4/multicast
11:44:22 | 50889 | outgoing-1 | - peer is not configured for bgp-ls/bgp-ls
11:44:22 | 50889 | outgoing-1 | - peer is not configured for ipv6/flow-vpn
11:44:22 | 50889 | outgoing-1 | - peer is not configured for bgp-ls/bgp-ls-vpn
11:44:22 | 50889 | outgoing-1 | - peer is not configured for l2vpn/evpn
11:44:22 | 50889 | outgoing-1 | - peer is not configured for ipv4/rtc
11:44:22 | 50889 | outgoing-1 | - peer is not configured for ipv4/nlri-mpls
11:44:22 | 50889 | outgoing-1 | - peer is not configured for ipv6/unicast
11:44:22 | 50889 | outgoing-1 | - peer is not configured for ipv4/flow
11:44:22 | 50889 | outgoing-1 | - peer is not configured for ipv6/mpls-vpn
11:44:22 | 50889 | outgoing-1 | - peer is not configured for ipv4/unicast
11:44:22 | 50889 | outgoing-1 | - peer is not configured for ipv4/flow-vpn
11:44:22 | 50889 | outgoing-1 | - peer is not configured for l2vpn/vpls
11:44:22 | 50889 | outgoing-1 | - peer is not configured for ipv6/multicast
11:44:22 | 50889 | outgoing-1 | - peer is not configured for ipv4/mpls-vpn
11:44:22 | 50889 | outgoing-1 | - peer is not configured for ipv6/nlri-mpls
11:44:22 | 50889 | outgoing-1 | - peer is not configured for ipv6/flow
11:44:22 | 50889 | outgoing-1 | therefore no routes of this kind can be announced on the connection
11:44:22 | 50889 | outgoing-1 | --------------------------------------------------------------------
Describe the feature
I would like to be able to specify options of the routingtable.ClientOptions when I do my ObserveRIB request, such as:
This way the client can decide what type of paths it wants to receive.
Currently the options are hard-coded:
rib.RegisterWithOptions(rc, routingtable.ClientOptions{
MaxPaths: 100,
})
It would also be nice if we could specify those options for the DumpRIB request.
Use cases / additional context
I have a client that uses ObserveRIB to re-build a router RIB locally,
but I only need ECMP best paths, so I would like to be able to specify those options.
On other clients, we may want to get the full feed for observability purposes.
Describe the feature
Support BGP extended next-hop, e.g. IPv4 AFI over IPv6 session (RFC5549)
Describe the bug
A clear and concise description of what the bug is.
Steps to Reproduce
in cmd/bio-rd/main.go, configure a bind IP for
listenAddrsByVRF := map[string][]string{
vrf.DefaultVRFName: {
"10.0.0.1:179",
},
}
Expected behavior
The program should bind the socket on the provided IP address.
Configuration used
routing_options:
autonomous_system: 111
router_id: 10.0.0.1
policy_options:
policy_statements:
- name: "ACCEPT_ALL"
terms:
- name: "ACCEPT_ALL"
then:
accept: true
- name: "REJECT_ALL"
terms:
- name: "REJECT_ALL"
then:
reject: true
protocols:
bgp:
groups:
- name: "IXP RS Clients"
local_address: 10.0.0.1
#route_server_client: true
passive: true
neighbors:
- peer_address: 10.0.0.2
peer_as: 111
import: ["ACCEPT_ALL"]
export: ["REJECT_ALL"]
Additional context
By modifying the code in net/tcp/listen.go the following way:
fmt.Println(laddr.IP)
fmt.Println(ipv4AddrToArray(laddr.IP))
if laddr.IP.To4() != nil {
err = unix.Bind(fd, &unix.SockaddrInet4{
Port: laddr.Port,
Addr: ipv4AddrToArray(laddr.IP),
})
} else {
err = unix.Bind(fd, &unix.SockaddrInet6{
Port: laddr.Port,
Addr: ipv6AddrToArray(laddr.IP),
})
}
I was able to produce the following output:
strace -e trace=network ./bio-rd
10.0.0.1
[0 0 0 0]
bind(13, {sa_family=AF_INET, sin_port=htons(2179), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
As you can see the bind call is 0.0.0.0 beccause ipv4AddrToArray returns [0 0 0 0].
Describe the bug
I am running the BGP server with around 20 peers, each with around 1M routes.
I am seeing high RAM usage. Running a pprof heap dump, I get the following flamegraph:
It looks to me like some resources are not released when the routes are processed by the filters ?
Steps to Reproduce
Run the router and check for RAM allocation.
Expected behavior
Only the RIB component should use a lot of RAM
Configuration used
b.AddPeer(server.PeerConfig{
LocalAS: 16276,
PeerAS: 16276,
RouterID: addr.ToUint32(),
PeerAddress: ip.Ptr(),
LocalAddress: locAddr.Ptr(),
AdminEnabled: true,
VRF: defaultVRF,
Passive: true,
AdvertiseIPv4MultiProtocol: true,
IPv4: &server.AddressFamilyConfig{
AddPathRecv: true,
ImportFilterChain: filter.NewAcceptAllFilterChain(),
ExportFilterChain: filter.NewDrainFilterChain(),
},
IPv6: &server.AddressFamilyConfig{
AddPathRecv: true,
ImportFilterChain: filter.NewAcceptAllFilterChain(),
ExportFilterChain: filter.NewDrainFilterChain(),
},
**Additional context **
We are running add-path with both IPv4 and IPv6 AFIs and unicast SAFI.
go: module github.com/golang/protobuf is deprecated: Use the "google.golang.org/protobuf" module instead.
I would like templates for BGP neighbor configuration. OpenBGPD does this as follows:
Instead of the neighbor's IP address, an address/netmask pair may be given:
neighbor 10.0.0.0/8
In this case, the neighbor specification becomes a template, and if a neighbor connects from an IP address within the given network, the template is cloned, inheriting everything from the template but the remote address, which is replaced by the connecting neighbor's address. With a template specification it is valid to omit remote-as; bgpd(8) will then accept any AS the neighbor presents in the OPEN message.
where is ospf?
Describe the feature
README.md improvement
Use cases / additional context
For new people curious about this project (like me), the current README.md leaves me stuck/unable to perceive how to build/test/run this project. Building the examples and testing coverage do currently work. But doing that left me ignorant about how to use/test bio-rd.
Rather than an issue report, it would be far better to have a mail-list for a conversation about assisting a newbie. But I could not find an email group or chat group.
Q. How do I build bio-rd?
Q. How do I run bio-rd?
(kindof expecting suggestions about docker setup??)
resolved by #96
Found with #101
panic: runtime error: slice bounds out of range
goroutine 1 [running]:
github.com/bio-routing/bio-rd/protocols/bgp/packet.deserializeMultiProtocolReachNLRI(0xc420018188, 0x8, 0x8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/tmp/go-fuzz-build543490251/gopath/src/github.com/bio-routing/bio-rd/protocols/bgp/packet/mp_reach_nlri.go:54 +0x8ae
github.com/bio-routing/bio-rd/protocols/bgp/packet.(*PathAttribute).decodeMultiProtocolReachNLRI(0xc42000c060, 0xc4200c2000, 0x1, 0x0)
/tmp/go-fuzz-build543490251/gopath/src/github.com/bio-routing/bio-rd/protocols/bgp/packet/path_attributes.go:146 +0x1f8
github.com/bio-routing/bio-rd/protocols/bgp/packet.decodePathAttr(0xc4200c2000, 0xc42005bee5, 0x5181e0, 0x5b6bb0, 0x4d8e60, 0xc42008e520)
/tmp/go-fuzz-build543490251/gopath/src/github.com/bio-routing/bio-rd/protocols/bgp/packet/path_attributes.go:112 +0xb1e
github.com/bio-routing/bio-rd/protocols/bgp/packet.decodePathAttrs(0xc4200c2000, 0xc420053030, 0xc42005bee5, 0x1, 0x0, 0x0)
/tmp/go-fuzz-build543490251/gopath/src/github.com/bio-routing/bio-rd/protocols/bgp/packet/path_attributes.go:23 +0x6d
github.com/bio-routing/bio-rd/protocols/bgp/packet.decodeUpdateMsg(0xc4200c2000, 0x1d, 0xc42005bee5, 0x68, 0x12, 0x4d8e60)
/tmp/go-fuzz-build543490251/gopath/src/github.com/bio-routing/bio-rd/protocols/bgp/packet/decoder.go:63 +0x15f
github.com/bio-routing/bio-rd/protocols/bgp/packet.decodeMsgBody(0xc4200c2000, 0xc4001d8102, 0xc42005bee5, 0x0, 0x5, 0x6, 0xc4200143a0)
/tmp/go-fuzz-build543490251/gopath/src/github.com/bio-routing/bio-rd/protocols/bgp/packet/decoder.go:36 +0xe7
github.com/bio-routing/bio-rd/protocols/bgp/packet.Decode(0xc4200c2000, 0xc42005bee5, 0xa, 0x45f576, 0x5b52081a)
/tmp/go-fuzz-build543490251/gopath/src/github.com/bio-routing/bio-rd/protocols/bgp/packet/decoder.go:20 +0x102
github.com/bio-routing/bio-rd/protocols/bgp/packet.Fuzz(0x7f12f6716000, 0x22, 0x200000, 0x4f98c0)
/tmp/go-fuzz-build543490251/gopath/src/github.com/bio-routing/bio-rd/protocols/bgp/packet/fuzzing.go:22 +0xbd
go-fuzz-dep.Main(0x50ac10)
/tmp/go-fuzz-build543490251/goroot/src/go-fuzz-dep/main.go:49 +0xad
main.main()
/tmp/go-fuzz-build543490251/gopath/src/github.com/bio-routing/bio-rd/protocols/bgp/packet/go.fuzz.main/main.go:10 +0x2d
exit status 2
Quoted input:
"\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x000\x02\x00" +
"\x0000a\x0e\b00000000"
Implement the router part of RFC 7854.
Would suggest https://docs.readthedocs.io/ for this.
Describe the bug
I've discovered that the example netlink is not longer existing and the functionality is now in the device example
Expected behavior
Documentation should be 1:1 with the actual code / examples
Note: routingtable/filter/term_condition.go comparison is currently incomplete.
I have it on good authority that IPv4+ is the 'next big thing'
https://www.ripe.net/ripe/mail/archives/members-discuss/2020-April/003676.html
Describe the feature
Document the slice order of paths in ris responses.
Use cases / additional context
For every route, the ris does return a list of paths. ris tries to imitate the path selection algorithm of the router, and returns the assumed best path at first. This is not documented properly.
OSPFv2/v3 with Area 0 support only
Panic found with #101 ๐
panic: runtime error: makeslice: len out of range
goroutine 1 [running]:
github.com/bio-routing/bio-rd/protocols/bgp/packet.deserializeMultiProtocolUnreachNLRI(0xc420018540, 0x1, 0x1, 0x1, 0x1, 0x0, 0x0, 0x5b6bb0, 0x4d8f20)
/tmp/go-fuzz-build543490251/gopath/src/github.com/bio-routing/bio-rd/protocols/bgp/packet/mp_unreach_nlri.go:33 +0x8c
github.com/bio-routing/bio-rd/protocols/bgp/packet.(*PathAttribute).decodeMultiProtocolUnreachNLRI(0xc42000c180, 0xc4200b0150, 0x1, 0x0)
/tmp/go-fuzz-build543490251/gopath/src/github.com/bio-routing/bio-rd/protocols/bgp/packet/path_attributes.go:165 +0x1c2
github.com/bio-routing/bio-rd/protocols/bgp/packet.decodePathAttr(0xc4200b0150, 0xc42005bee5, 0x5181e0, 0x5b6bb0, 0x4d8e60, 0xc4200885b0)
/tmp/go-fuzz-build543490251/gopath/src/github.com/bio-routing/bio-rd/protocols/bgp/packet/path_attributes.go:116 +0xa59
github.com/bio-routing/bio-rd/protocols/bgp/packet.decodePathAttrs(0xc4200b0150, 0xc420053030, 0xc42005bee5, 0x1, 0x0, 0x0)
/tmp/go-fuzz-build543490251/gopath/src/github.com/bio-routing/bio-rd/protocols/bgp/packet/path_attributes.go:23 +0x6d
github.com/bio-routing/bio-rd/protocols/bgp/packet.decodeUpdateMsg(0xc4200b0150, 0x1d, 0xc42005bee5, 0x68, 0x12, 0x4d8e60)
/tmp/go-fuzz-build543490251/gopath/src/github.com/bio-routing/bio-rd/protocols/bgp/packet/decoder.go:63 +0x15f
github.com/bio-routing/bio-rd/protocols/bgp/packet.decodeMsgBody(0xc4200b0150, 0xc4001d8402, 0xc42005bee5, 0x0, 0x5, 0x6, 0xc420014480)
/tmp/go-fuzz-build543490251/gopath/src/github.com/bio-routing/bio-rd/protocols/bgp/packet/decoder.go:36 +0xe7
github.com/bio-routing/bio-rd/protocols/bgp/packet.Decode(0xc4200b0150, 0xc42005bee5, 0xa, 0x45f576, 0x5b52081b)
/tmp/go-fuzz-build543490251/gopath/src/github.com/bio-routing/bio-rd/protocols/bgp/packet/decoder.go:20 +0x102
github.com/bio-routing/bio-rd/protocols/bgp/packet.Fuzz(0x7f17bc462000, 0x1b, 0x200000, 0x3)
/tmp/go-fuzz-build543490251/gopath/src/github.com/bio-routing/bio-rd/protocols/bgp/packet/fuzzing.go:22 +0xbd
go-fuzz-dep.Main(0x50ac10)
/tmp/go-fuzz-build543490251/goroot/src/go-fuzz-dep/main.go:49 +0xad
main.main()
/tmp/go-fuzz-build543490251/gopath/src/github.com/bio-routing/bio-rd/protocols/bgp/packet/go.fuzz.main/main.go:10 +0x2d
exit status 2```
Quoted input:
"\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x000\x02\x00" +
"\x0000\x00\x0f\x010"
I want to use this in my project. However, I do not found any documents. Do you hava a website or something else?
Thanks.
Found with #101:
panic: runtime error: makeslice: len out of range
goroutine 1 [running]:
github.com/bio-routing/bio-rd/protocols/bgp/packet.deserializeMultiProtocolReachNLRI(0x5b6bb0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/tmp/go-fuzz-build543490251/gopath/src/github.com/bio-routing/bio-rd/protocols/bgp/packet/mp_reach_nlri.go:41 +0xd3
github.com/bio-routing/bio-rd/protocols/bgp/packet.(*PathAttribute).decodeMultiProtocolReachNLRI(0xc42000c0c0, 0xc4200aa000, 0x1, 0x0)
/tmp/go-fuzz-build543490251/gopath/src/github.com/bio-routing/bio-rd/protocols/bgp/packet/path_attributes.go:146 +0x1f8
github.com/bio-routing/bio-rd/protocols/bgp/packet.decodePathAttr(0xc4200aa000, 0xc42005bee5, 0x5181e0, 0x5b6bb0, 0x4d8e60, 0xc42007a520)
/tmp/go-fuzz-build543490251/gopath/src/github.com/bio-routing/bio-rd/protocols/bgp/packet/path_attributes.go:112 +0xb1e
github.com/bio-routing/bio-rd/protocols/bgp/packet.decodePathAttrs(0xc4200aa000, 0xc420053030, 0xc42005bee5, 0x1, 0x0, 0x0)
/tmp/go-fuzz-build543490251/gopath/src/github.com/bio-routing/bio-rd/protocols/bgp/packet/path_attributes.go:23 +0x6d
github.com/bio-routing/bio-rd/protocols/bgp/packet.decodeUpdateMsg(0xc4200aa000, 0x1d, 0xc42005bee5, 0x68, 0x12, 0x4d8e60)
/tmp/go-fuzz-build543490251/gopath/src/github.com/bio-routing/bio-rd/protocols/bgp/packet/decoder.go:63 +0x15f
github.com/bio-routing/bio-rd/protocols/bgp/packet.decodeMsgBody(0xc4200aa000, 0xc4001d8302, 0xc42005bee5, 0x0, 0x5, 0x6, 0xc4200143e0)
/tmp/go-fuzz-build543490251/gopath/src/github.com/bio-routing/bio-rd/protocols/bgp/packet/decoder.go:36 +0xe7
github.com/bio-routing/bio-rd/protocols/bgp/packet.Decode(0xc4200aa000, 0xc42005bee5, 0xa, 0x45f576, 0x5b520819)
/tmp/go-fuzz-build543490251/gopath/src/github.com/bio-routing/bio-rd/protocols/bgp/packet/decoder.go:20 +0x102
github.com/bio-routing/bio-rd/protocols/bgp/packet.Fuzz(0x7f2cde870000, 0x1a, 0x200000, 0x4f98c0)
/tmp/go-fuzz-build543490251/gopath/src/github.com/bio-routing/bio-rd/protocols/bgp/packet/fuzzing.go:22 +0xbd
go-fuzz-dep.Main(0x50ac10)
/tmp/go-fuzz-build543490251/goroot/src/go-fuzz-dep/main.go:49 +0xad
main.main()
/tmp/go-fuzz-build543490251/gopath/src/github.com/bio-routing/bio-rd/protocols/bgp/packet/go.fuzz.main/main.go:10 +0x2d
exit status 2
Quoted input:
"\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x000\x02\x00" +
"\x0000\x01\x0e\x00"
Describe the bug
When a route from an eBGP neighbor is received and no policies are configured for this neighbor, the Local-Pref will be set to 0. Without any policies configured the Local-Pref should instead be set to 100, which is the correct default value.
Steps to Reproduce
Build examples/bgp
and peer with another BGP speaker which has a different AS. Announce a route from the other BGP speaker towards bio-rd.
Expected behavior
I expect bio-rd to set a default Local-Pref of 100 for all received routes which do not have Local-Pref set, before any policies are evaluated.
Configuration used
Peer config for examples/bgp
:
func addPeersIPv4(b server.BGPServer, v *vrf.VRF) {
b.AddPeer(server.PeerConfig{
AdminEnabled: true,
LocalAS: 65200,
PeerAS: 65300,
PeerAddress: bnet.IPv4FromOctets(127, 0, 0, 1).Ptr(),
LocalAddress: bnet.IPv4FromOctets(127, 0, 0, 1).Ptr(),
ReconnectInterval: time.Second * 15,
HoldTime: time.Second * 90,
KeepAlive: time.Second * 30,
Passive: true,
//RouterID: b.RouterID(),
RouterID: uint32(1),
IPv4: &server.AddressFamilyConfig{
//ImportFilterChain: filter.NewAcceptAllFilterChain(),
ExportFilterChain: filter.NewAcceptAllFilterChain(),
AddPathSend: routingtable.ClientOptions{
MaxPaths: 10,
},
},
RouteServerClient: true,
VRF: v,
})
}
Other BGP speaker was gobgp. Config:
[global.config]
as = 65300
router-id = "192.168.255.1"
port = 1790
[[neighbors]]
[neighbors.config]
neighbor-address = "127.0.0.1"
peer-as = 65200
[neighbors.transport.config]
local-address = "127.0.0.1"
remote-port = 179
Inject route:
$ gobgp global rib add 192.168.1.1/32 -a ipv4
Check route in bio-rd:
$ go run ./cmd/bio-rdc/main.go -bio-rd localhost:1337 -cmd "show routes receive-protocol bgp 127.0.0.1"
192.168.1.1/32:
All Paths:
Protocol: BGP
Hidden: no
Local Pref: 0
Origin: Incomplete
AS Path: 65300
BGP type: external
NEXT HOP: 127.0.0.1
MED: 0
Path ID: 0
Source: 127.0.0.1
Local-Pref should be 100 not 0.
Please rename pfxlen
into length
, because prefix.pfxlen
stutters.
message Prefix {
IP address = 1;
uint32 length = 2; // before: pfxlen
}
type Prefix struct {
addr IP
pfxlen uint8 // better: len or length
}
The build on Darwin (OS X) is broken due to dependencies on the Netlink library.
I'd prefer not to have a working netlink at all in favour of not being able to build.
Please fix.
Describe the feature
Currently bio-routing always compares MED values, even if the ASes of different paths are different - this should be configurable as it is in other implementations.
Also add a config option for the RIS/BMP Monitoring station which allows setting this.
Describe the bug
When local_address is not specified on a BGP neighbor bio-rd crashes on startup.
Steps to Reproduce
Create bio-rd config with a BGP neighbor without specifying local_address and start bio-rd.
Expected behavior
It must not crash but should either throw an error asking for the complete config or detect the local address automatically.
fsmAddressFamily.initialized is never set to true. But is evalutated in dispose() method. This resources tables are never unregistered and go routines never stopped.
Describe the bug
bgpPathACache
causes large memory leaks and is itself not caching anything that can be retrieved. The result is an ever increasing map which consumes all memory until depletion. This is a combination of issues described in detail below.
p
(type BGPPathA
) is copied and added to the map index, resulting in a duplication of the contents.
bio-rd/route/bgp_path_cache.go
Line 34 in 63eef2b
BGPPathA
contains ptrs that always reference new memory (line 131 & 138). The map index therefore becomes unique for each new BGPPathA
created. No dedup happens here.
Lines 129 to 145 in 63eef2b
Even if this cache would work, there is no mechanism for cache eviction. For very long running instances and many changes, this would always grow until no memory is available anymore.
Steps to Reproduce
run ris-mirror, have route updates, ram go brrr and poof
Expected behavior
ris-mirros shouldn't leak memory and can run for long times
Configuration used
this is config independent as the code path is always used in ris-mirror
Additional context
I've done a lot of profiling on this issue und very confident this is the major source of leaks for ris-mirror. Simply running without cache works very nicely and shows generally better peformance.
Happy to provide a PR to fix this, depening on what solution is preferred. Removing cache seems like a better tradeoff than redesigning the entire cache strategy for probably marginal benefits.
Describe the bug
Cannot build a docker image with given Dockerfile in docker/bio-rd/Dockerfile
Steps to Reproduce
cd docker/bio-rd
docker build --tag 'rickys' .
(attempted workaround)
cp ../../go.mod .
docker build --tag 'rickys' .
(2nd attempted workaround)
cd ../.. (top dir of bio-rd)
docker build --tag 'rickys' docker/bio-rd/
Expected behavior
successfully build a docker image which contains bio-rd binary
Configuration used
charletr@hpnsw4371:/ws/charletr/bio-rd$ uname -a
Linux hpnsw4371.rose.rdlabs.hpecorp.net 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
charletr@hpnsw4371:/ws/charletr/bio-rd$ cat /etc/issue
Ubuntu 16.04.7 LTS \n \l
(FYI, I can try on a much more modern ubuntu tonight)
charletr@hpnsw4371:/ws/charletr/bio-rd$ go version
go version go1.21.5 linux/amd64
charletr@hpnsw4371:/ws/charletr/bio-rd$ docker --version
Docker version 19.03.5, build 633a0ea838
Additional context
charletr@hpnsw4371:/ws/charletr/bio-rd/docker/bio-rd$ docker build --tag 'rickys' .
Sending build context to Docker daemon 2.048kB
Step 1/14 : FROM golang as builder
---> 0505a58fa464
Step 2/14 : ADD . /go/bio-rd
---> Using cache
---> 8c33e3997e5b
Step 3/14 : WORKDIR /go/bio-rd/cmd/bio-rd
---> Using cache
---> a1c5c3f03c71
Step 4/14 : RUN GOOS=linux go build -o /go/bin/bio-rd
---> Running in 0a6717ac9217
go: go.mod file not found in current directory or any parent directory; see 'go help modules'
The command '/bin/sh -c GOOS=linux go build -o /go/bin/bio-rd' returned a non-zero code: 1
charletr@hpnsw4371:/ws/charletr/bio-rd/docker/bio-rd$
charletr@hpnsw4371:/ws/charletr/bio-rd/docker/bio-rd$
charletr@hpnsw4371:/ws/charletr/bio-rd/docker/bio-rd$
charletr@hpnsw4371:/ws/charletr/bio-rd/docker/bio-rd$
charletr@hpnsw4371:/ws/charletr/bio-rd/docker/bio-rd$ cp ../../go.mod .
charletr@hpnsw4371:/ws/charletr/bio-rd/docker/bio-rd$ docker build --tag 'rickys' .
Sending build context to Docker daemon 4.096kB
Step 1/14 : FROM golang as builder
---> 0505a58fa464
Step 2/14 : ADD . /go/bio-rd
---> Using cache
---> 3ba4b8eb2ff0
Step 3/14 : WORKDIR /go/bio-rd/cmd/bio-rd
---> Using cache
---> 4055e5f810c9
Step 4/14 : RUN GOOS=linux go build -o /go/bin/bio-rd
---> Running in f35ac8f4b014
no Go files in /go/bio-rd/cmd/bio-rd
The command '/bin/sh -c GOOS=linux go build -o /go/bin/bio-rd' returned a non-zero code: 1
charletr@hpnsw4371:/ws/charletr/bio-rd/docker/bio-rd$
charletr@hpnsw4371:/ws/charletr/bio-rd/docker/bio-rd$
charletr@hpnsw4371:/ws/charletr/bio-rd/docker/bio-rd$
charletr@hpnsw4371:/ws/charletr/bio-rd/docker/bio-rd$
charletr@hpnsw4371:/ws/charletr/bio-rd/docker/bio-rd$
charletr@hpnsw4371:/ws/charletr/bio-rd/docker/bio-rd$
charletr@hpnsw4371:/ws/charletr/bio-rd/docker/bio-rd$ cd ..
charletr@hpnsw4371:/ws/charletr/bio-rd/docker$ cd ..
charletr@hpnsw4371:/ws/charletr/bio-rd$ docker build --tag 'rickys' .
unable to prepare context: unable to evaluate symlinks in Dockerfile path: lstat /ws/charletr/bio-rd/Dockerfile: no such file or directory
charletr@hpnsw4371:/ws/charletr/bio-rd$ docker build --tag 'rickys' docker/bio-rd/
Sending build context to Docker daemon 4.096kB
Step 1/14 : FROM golang as builder
---> 0505a58fa464
Step 2/14 : ADD . /go/bio-rd
---> Using cache
---> 3ba4b8eb2ff0
Step 3/14 : WORKDIR /go/bio-rd/cmd/bio-rd
---> Using cache
---> 4055e5f810c9
Step 4/14 : RUN GOOS=linux go build -o /go/bin/bio-rd
---> Running in 4f20223002b8
no Go files in /go/bio-rd/cmd/bio-rd
The command '/bin/sh -c GOOS=linux go build -o /go/bin/bio-rd' returned a non-zero code: 1
charletr@hpnsw4371:/ws/charletr/bio-rd$
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.