volcano.sh/volcano@v1.9.0/example/custom-plugin/README.md (about)

     1  # Build plugin
     2  
     3  ## Use musl-libc build plugin
     4  
     5  Because the default `vc-scheduler` base image is `alpine`, which only has `musl-libc`, so we should use `musl-gcc` to
     6  build the plugin.
     7  
     8  ```bash
     9  docker run -v `pwd`:/work golang:1.14-alpine sh -c "cd /work && apk add musl-dev gcc && go build -buildmode=plugin magic.go"
    10  ```
    11  
    12  Or build the plugin in local.
    13  
    14  ```bash
    15  # install musl
    16  wget http://musl.libc.org/releases/musl-1.2.1.tar.gz
    17  tar -xf musl-1.2.1.tar.gz && cd musl-1.2.1
    18  ./configure
    19  make && sudo make install
    20  
    21  # build plugin
    22  CC=/usr/local/musl/bin/musl-gcc CGO_ENABLED=1 go build -buildmode=plugin magic.go
    23  ```
    24  
    25  ## Use gnu-libc build plugin
    26  
    27  If want to use `ubuntu` as base image, you can use `gnu-libc` to build the plugin. Since most Linux OS have `gnu-libc`,
    28  you can just build the plugin in local.
    29  
    30  ```bash
    31  # default CC is gcc
    32  CGO_ENABLED=1 go build -buildmode=plugin magic.go
    33  ```