diff --git a/container.go b/container.go
index 11a13b4..867c3f7 100644
--- a/container.go
+++ b/container.go
@@ -43,10 +43,20 @@ type ContainerGoProps struct {
// Toolchain configuration for building Go Lambda function
Toolchain *Toolchain
+ // Path to Dockerfile relative to the module,
+ // if not specified, the default Dockerfile will be generated.
+ //
+ // The file must contain:
+ // ADD bootstrap /bin/bootstrap
+ // CMD ["/bin/bootstrap"]
+ Dockerfile string
+
// Static files included into container, the path is relative to module
+ // Only added to container if Dockerfile is not specified, otherwise it's caller responsibility to add them into container within Dockerfile
StaticAssets []string
// Linux Alpine Packages (apk) to be installed within the container
+ // Only added to container if Dockerfile is not specified, otherwise it's caller responsibility to add them into container within Dockerfile
Packages []string
}
@@ -115,7 +125,15 @@ func NewContainerGo(scope constructs.Construct, id *string, spec *ContainerGoPro
panic(fmt.Errorf("unable to build %s/%s", spec.SourceCodeModule, spec.SourceCodeLambda))
}
- docker := fmt.Sprintf(`
+ if spec.Dockerfile != "" {
+ source := filepath.Join(rootSourceCode(spec.SourceCodeModule), spec.Dockerfile)
+ target := filepath.Join(path, "Dockerfile")
+ log.Printf("==> copy %s\n", spec.Dockerfile)
+ if err := copy(source, target); err != nil {
+ panic(err)
+ }
+ } else {
+ docker := fmt.Sprintf(`
FROM %s
%s
%s
@@ -124,9 +142,10 @@ ADD bootstrap /bin/bootstrap
CMD ["/bin/bootstrap"]
`, dockerBaseImage(spec), dockerPackages(spec), dockerAssets(path, spec))
- err := os.WriteFile(filepath.Join(path, "Dockerfile"), []byte(docker), 0664)
- if err != nil {
- panic(err)
+ err := os.WriteFile(filepath.Join(path, "Dockerfile"), []byte(docker), 0664)
+ if err != nil {
+ panic(err)
+ }
}
props.Code = awslambda.DockerImageCode_FromImageAsset(
diff --git a/doc/scud-logo-v2.svg b/doc/scud-logo-v2.svg
index 27ebf95..a363899 100644
--- a/doc/scud-logo-v2.svg
+++ b/doc/scud-logo-v2.svg
@@ -8,7 +8,7 @@
version="1.1"
id="svg1"
xml:space="preserve"
- inkscape:version="1.4.2 (ebf0e940, 2025-05-08)"
+ inkscape:version="1.4.3 (0d15f75, 2025-12-25)"
sodipodi:docname="scud-logo-v2.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
@@ -23,13 +23,13 @@
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
- inkscape:zoom="1.399126"
- inkscape:cx="195.12181"
- inkscape:cy="124.72072"
+ inkscape:zoom="5.6248215"
+ inkscape:cx="168.00533"
+ inkscape:cy="150.84923"
inkscape:window-width="1216"
inkscape:window-height="708"
inkscape:window-x="0"
- inkscape:window-y="38"
+ inkscape:window-y="34"
inkscape:window-maximized="0"
inkscape:current-layer="layer1" />
+ sodipodi:nodetypes="cssscssscsccsssscsssssssssscsssssssssssssssscsscsssssscsssscsccssscssssssssscscssssssssssssssssscssssssssssscsssssss" />