feat(software): install buildx plugin from docker repo

!1
This commit is contained in:
2023-05-13 15:10:22 +09:30
parent 92c1cefb95
commit 069a47808a

View File

@ -9,18 +9,17 @@ RUN apt-get update && apt-get install -y \
software-properties-common \ software-properties-common \
python3 \ python3 \
python3-pip || true python3-pip || true
# Install Docker and qemu
RUN curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - && \
add-apt-repository "deb https://download.docker.com/linux/debian $(lsb_release -cs) stable" && \ add-apt-repository "deb https://download.docker.com/linux/debian $(lsb_release -cs) stable" && \
apt-get update && apt-get install -y \ apt-get update && apt-get install -y \
docker-buildx-plugin \
docker-ce-cli \ docker-ce-cli \
binfmt-support \ binfmt-support \
qemu-user-static qemu-user-static || true
# Install buildx plugin
RUN mkdir -p ~/.docker/cli-plugins && \
ARCH=`dpkg --print-architecture` && echo Running on $ARCH && curl -s https://api.github.com/repos/docker/buildx/releases/latest | \
grep "browser_download_url.*linux-$ARCH" | cut -d : -f 2,3 | tr -d \" | \
xargs curl -L -o ~/.docker/cli-plugins/docker-buildx && \
chmod a+x ~/.docker/cli-plugins/docker-buildx
# Write version file # Write version file
RUN printf "$(docker --version | perl -pe 's/^.*\s(\d+\.\d+\.\d+.*),.*$/$1/')_$(docker buildx version | perl -pe 's/^.*v?(\d+\.\d+\.\d+).*$/$1/')" > /version && \ RUN printf "$(docker --version | perl -pe 's/^.*\s(\d+\.\d+\.\d+.*),.*$/$1/')_$(docker buildx version | perl -pe 's/^.*v?(\d+\.\d+\.\d+).*$/$1/')" > /version && \