Skip to content

Commit

Permalink
update default scaffolded opm base image
Browse files Browse the repository at this point in the history
- Change default base image scaffolded during `opm index` and `opm alpha
  generate dockerfile` to `quay.io/operator-framework/opm:latest`
- update opm-example.Dockerfile to reflect this change (and to focus on
  file-based configs rather than sqlite databases)

Signed-off-by: Joe Lanford <[email protected]>
  • Loading branch information
joelanford committed Aug 25, 2021
1 parent a0bb1e5 commit 07c8880
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
23 changes: 13 additions & 10 deletions opm-example.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
FROM quay.io/operator-framework/upstream-opm-builder AS builder
# The base image is expected to contain
# /bin/opm (with a serve subcommand) and /bin/grpc_health_probe
FROM quay.io/operator-framework/opm:latest

FROM scratch
LABEL operators.operatorframework.io.index.database.v1=./index.db
COPY ["nsswitch.conf", "/etc/nsswitch.conf"]
COPY database ./
COPY --from=builder /bin/opm /opm
COPY --from=builder /bin/grpc_health_probe /bin/grpc_health_probe
EXPOSE 50051
ENTRYPOINT ["/opm"]
CMD ["registry", "serve", "--database", "index.db"]
# Configure the entrypoint and command
ENTRYPOINT ["/bin/opm"]
CMD ["serve", "/configs"]

# Copy declarative config root into image at /configs
ADD index /configs

# Set DC-specific label for the location of the DC root directory
# in the image
LABEL operators.operatorframework.io.index.configs.v1=/configs
2 changes: 1 addition & 1 deletion pkg/containertools/dockerfilegenerator.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
)

const (
DefaultBinarySourceImage = "quay.io/operator-framework/upstream-opm-builder"
DefaultBinarySourceImage = "quay.io/operator-framework/opm:latest"
DefaultDbLocation = "/database/index.db"
DbLocationLabel = "operators.operatorframework.io.index.database.v1"
ConfigsLocationLabel = "operators.operatorframework.io.index.configs.v1"
Expand Down
6 changes: 3 additions & 3 deletions pkg/containertools/dockerfilegenerator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package containertools_test
import (
"testing"

"github.com/operator-framework/operator-registry/pkg/containertools"

"github.com/golang/mock/gomock"
"github.com/sirupsen/logrus"
"github.com/stretchr/testify/require"

"github.com/operator-framework/operator-registry/pkg/containertools"
)

func TestGenerateDockerfile(t *testing.T) {
Expand Down Expand Up @@ -39,7 +39,7 @@ func TestGenerateDockerfile_EmptyBaseImage(t *testing.T) {
defer controller.Finish()

databasePath := "database/index.db"
expectedDockerfile := `FROM quay.io/operator-framework/upstream-opm-builder
expectedDockerfile := `FROM quay.io/operator-framework/opm:latest
LABEL operators.operatorframework.io.index.database.v1=/database/index.db
ADD database/index.db /database/index.db
EXPOSE 50051
Expand Down

0 comments on commit 07c8880

Please sign in to comment.