Is the container used within the method in function library?
When the container is not used, you simply could call the method with "null" for container.
e.g. String result = new MyFunctionLib().myFunction("var1","var2", null);
Otherwise it is not possible, as you cannot create an instance for the Container interface easily.