Use ARG instead of sed to set the base image for addon-manager.

This commit is contained in:
Vinayak Goyal 2021-02-12 03:11:56 -08:00
parent e059af6406
commit ad1e2ffab0
2 changed files with 4 additions and 3 deletions

View File

@ -12,7 +12,9 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
FROM BASEIMAGE ARG BASEIMAGE
FROM ${BASEIMAGE}
RUN clean-install bash RUN clean-install bash

View File

@ -30,14 +30,13 @@ build:
cp ./* $(TEMP_DIR) cp ./* $(TEMP_DIR)
curl -sSL --retry 5 https://dl.k8s.io/release/$(KUBECTL_VERSION)/bin/linux/$(ARCH)/kubectl > $(TEMP_DIR)/kubectl curl -sSL --retry 5 https://dl.k8s.io/release/$(KUBECTL_VERSION)/bin/linux/$(ARCH)/kubectl > $(TEMP_DIR)/kubectl
chmod a+rx $(TEMP_DIR)/kube-addons.sh $(TEMP_DIR)/kube-addons-main.sh $(TEMP_DIR)/kubectl chmod a+rx $(TEMP_DIR)/kube-addons.sh $(TEMP_DIR)/kube-addons-main.sh $(TEMP_DIR)/kubectl
cd $(TEMP_DIR) && sed -i.back "s|BASEIMAGE|$(BASEIMAGE)|g" Dockerfile
ifneq ($(ARCH),amd64) ifneq ($(ARCH),amd64)
# Register /usr/bin/qemu-ARCH-static as the handler for non-x86 binaries in the kernel # Register /usr/bin/qemu-ARCH-static as the handler for non-x86 binaries in the kernel
$(SUDO) ../../../third_party/multiarch/qemu-user-static/register/register.sh --reset $(SUDO) ../../../third_party/multiarch/qemu-user-static/register/register.sh --reset
endif endif
docker build --pull -t $(IMAGE)-$(ARCH):$(VERSION) $(TEMP_DIR) docker build --pull -t $(IMAGE)-$(ARCH):$(VERSION) $(TEMP_DIR) --build-arg BASEIMAGE=$(BASEIMAGE)
push: build push: build
docker push $(IMAGE)-$(ARCH):$(VERSION) docker push $(IMAGE)-$(ARCH):$(VERSION)