Skip to content

Commit 0a190a8

Browse files
authoredAug 31, 2021
update default scaffolded opm base image (operator-framework#762)
- 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]>
1 parent 3f6a698 commit 0a190a8

File tree

3 files changed

+17
-14
lines changed

3 files changed

+17
-14
lines changed
 

‎opm-example.Dockerfile

+13-10
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
FROM quay.io/operator-framework/upstream-opm-builder AS builder
1+
# The base image is expected to contain
2+
# /bin/opm (with a serve subcommand) and /bin/grpc_health_probe
3+
FROM quay.io/operator-framework/opm:latest
24

3-
FROM scratch
4-
LABEL operators.operatorframework.io.index.database.v1=./index.db
5-
COPY ["nsswitch.conf", "/etc/nsswitch.conf"]
6-
COPY database ./
7-
COPY --from=builder /bin/opm /opm
8-
COPY --from=builder /bin/grpc_health_probe /bin/grpc_health_probe
9-
EXPOSE 50051
10-
ENTRYPOINT ["/opm"]
11-
CMD ["registry", "serve", "--database", "index.db"]
5+
# Configure the entrypoint and command
6+
ENTRYPOINT ["/bin/opm"]
7+
CMD ["serve", "/configs"]
8+
9+
# Copy declarative config root into image at /configs
10+
ADD index /configs
11+
12+
# Set DC-specific label for the location of the DC root directory
13+
# in the image
14+
LABEL operators.operatorframework.io.index.configs.v1=/configs

‎pkg/containertools/dockerfilegenerator.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
)
99

1010
const (
11-
DefaultBinarySourceImage = "quay.io/operator-framework/upstream-opm-builder"
11+
DefaultBinarySourceImage = "quay.io/operator-framework/opm:latest"
1212
DefaultDbLocation = "/database/index.db"
1313
DbLocationLabel = "operators.operatorframework.io.index.database.v1"
1414
ConfigsLocationLabel = "operators.operatorframework.io.index.configs.v1"

‎pkg/containertools/dockerfilegenerator_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ package containertools_test
33
import (
44
"testing"
55

6-
"github.com/operator-framework/operator-registry/pkg/containertools"
7-
86
"github.com/golang/mock/gomock"
97
"github.com/sirupsen/logrus"
108
"github.com/stretchr/testify/require"
9+
10+
"github.com/operator-framework/operator-registry/pkg/containertools"
1111
)
1212

1313
func TestGenerateDockerfile(t *testing.T) {
@@ -39,7 +39,7 @@ func TestGenerateDockerfile_EmptyBaseImage(t *testing.T) {
3939
defer controller.Finish()
4040

4141
databasePath := "database/index.db"
42-
expectedDockerfile := `FROM quay.io/operator-framework/upstream-opm-builder
42+
expectedDockerfile := `FROM quay.io/operator-framework/opm:latest
4343
LABEL operators.operatorframework.io.index.database.v1=/database/index.db
4444
ADD database/index.db /database/index.db
4545
EXPOSE 50051

0 commit comments

Comments
 (0)
Please sign in to comment.