Skip to content

Commit b3c126d

Browse files
committed
update
1 parent bb2f8cf commit b3c126d

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

cpp-cicd/Dockerfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
FROM ubuntu:latest
2+
23
ENV NJOBS=8
34
ENV CONDA_HOME=/root/anaconda3
45
ENV PATH=${CONDA_HOME}/bin:${PATH}
56

7+
ARG TARGETPLATFORM
8+
ARG BUILDPLATFORM
9+
610
# ubuntu
711
RUN apt-get update -y \
812
&& apt-get upgrade -y \
@@ -26,7 +30,9 @@ RUN apt-get update -y \
2630
wget
2731

2832
# anaconda
29-
RUN wget -q https://repo.anaconda.com/archive/Anaconda3-2023.03-1-Linux-x86_64.sh -O /tmp/anaconda.sh \
33+
COPY scripts/download-conda.sh /tmp/download-conda.sh
34+
RUN chmod +x /tmp/download-conda.sh \
35+
&& /bin/bash /tmp/download-conda.sh \
3036
&& /bin/bash /tmp/anaconda.sh -b -p $CONDA_HOME \
3137
&& conda update conda -y \
3238
&& conda update --all -y \

cpp-cicd/Makefile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ IMAGE_VERSION = $(ORGANIZATION)/$(REPOSITORY):$(VERSION)
88
IMAGE_LATEST = $(ORGANIZATION)/$(REPOSITORY):latest
99

1010
build:
11-
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t $(IMAGE_VERSION) .
12-
docker tag $(IMAGE_VERSION) ${IMAGE_LATEST}
11+
docker buildx build --platform linux/amd64,linux/arm64 -t $(IMAGE_VERSION) --push .
1312

1413
push:
15-
docker push ${IMAGE_VERSION}
16-
docker push ${IMAGE_LATEST}
14+
docker push ${IMAGE_VERSION}

cpp-cicd/scripts/download-conda.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
if [ $TARGETPLATFORM == "linux/arm64" ]
3+
then
4+
echo "downloading anaconda for linux/arm64"
5+
wget -q https://repo.anaconda.com/archive/Anaconda3-2023.03-1-Linux-aarch64.sh -O /tmp/anaconda.sh
6+
else
7+
echo "downloading anaconda for linux/amd64"
8+
wget -q https://repo.anaconda.com/archive/Anaconda3-2023.03-1-Linux-x86_64.sh -O /tmp/anaconda.sh
9+
fi

0 commit comments

Comments
 (0)