mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 02:41:25 +00:00
Use ARG instead of sed to set the base image for addon-manager.
This commit is contained in:
parent
e059af6406
commit
ad1e2ffab0
@ -12,7 +12,9 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
FROM BASEIMAGE
|
||||
ARG BASEIMAGE
|
||||
|
||||
FROM ${BASEIMAGE}
|
||||
|
||||
RUN clean-install bash
|
||||
|
||||
|
@ -30,14 +30,13 @@ build:
|
||||
cp ./* $(TEMP_DIR)
|
||||
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
|
||||
cd $(TEMP_DIR) && sed -i.back "s|BASEIMAGE|$(BASEIMAGE)|g" Dockerfile
|
||||
|
||||
ifneq ($(ARCH),amd64)
|
||||
# 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
|
||||
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
|
||||
docker push $(IMAGE)-$(ARCH):$(VERSION)
|
||||
|
Loading…
Reference in New Issue
Block a user