Skip to content
This repository has been archived by the owner on May 27, 2024. It is now read-only.

Plugins are not built and included in the Docker Image #37

Merged
1 commit merged into from
Aug 12, 2022

Conversation

ghost
Copy link

@ghost ghost commented Aug 12, 2022

Summary

We enabled plugin support for OpsTool. But those images were not included in the builds and generating containers. Cause of it we are generating unusable docker images.

PR contains changes to build every plugin and include them in the container.

Plugin artifacts will be stored under dist/plugins folder.

To configure a plugin in the builds:

  1. Create a makefile in the plugin folder and add build target which generates artifact at ../../dist/plugins` folder.
  2. Modify main Makefile and add plugin name to the OPS_TOOL_PLUGINS list.

CGO_ENABLED=1

We started to build with CGO_ENABLED cause plugin builds needs that configuration since plugins requires dynamic linker.
Details are here: golang/go#19569

Docker image change

At Distroless image bash is not installed and our bash plugin fails. To make bash plugin work and not build docker image frequently (cause of bash plugin and command needs), changed runner base image to debian.

Ticket Link

Fixes #35

@ghost ghost self-requested a review as a code owner August 12, 2022 12:10
@ghost ghost linked an issue Aug 12, 2022 that may be closed by this pull request
@ghost ghost force-pushed the fature/35-improve-makefile-to-build-and-distribute-plugins branch from 5686e1b to c8ad5bc Compare August 12, 2022 12:49
@ghost ghost force-pushed the fature/35-improve-makefile-to-build-and-distribute-plugins branch from c8ad5bc to 6a6c37d Compare August 12, 2022 12:51
@ghost ghost requested review from phoinixgrr, spirosoik and JulienTant August 12, 2022 12:52
@@ -4,15 +4,15 @@ listen: "0.0.0.0:8080"
base_url: "https://op-tools-address.com"
plugins:
- name: bash_useful
file: plugins/bash.so
file: dist/plugins/bash.so
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sample configuration is changed since build generates plugins in dist folder at repository. So make go-run will work when user executes the project from code base.

@ghost ghost merged commit 9af96aa into main Aug 12, 2022
@ghost ghost deleted the fature/35-improve-makefile-to-build-and-distribute-plugins branch August 12, 2022 12:57
@JulienTant
Copy link
Member

Awesome thanks!

This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve makefile to build and distribute plugins
3 participants