Skip to content

Commit 951ba5e

Browse files
author
Jorge Martinez
committed
FIX: copy Python STD lib into the final image
1 parent d5ebeb2 commit 951ba5e

File tree

7 files changed

+32
-15
lines changed

7 files changed

+32
-15
lines changed

docker/linux/docker-compose.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ services:
3131
build:
3232
context: ./stk-engine-py38
3333
args:
34-
baseImage: ansys/stk:latest-centos7-pybase
34+
baseImage: ansys/stk:latest-centos7
35+
basePythonImage: ansys/stk:latest-centos7-pybase
3536
environment:
3637
- ANSYSLMD_LICENSE_FILE=$ANSYSLMD_LICENSE_FILE
3738

@@ -43,7 +44,8 @@ services:
4344
build:
4445
context: ./stk-engine-py39
4546
args:
46-
baseImage: ansys/stk:latest-centos7-pybase
47+
baseImage: ansys/stk:latest-centos7
48+
basePythonImage: ansys/stk:latest-centos7-pybase
4749
environment:
4850
- ANSYSLMD_LICENSE_FILE=$ANSYSLMD_LICENSE_FILE
4951

@@ -55,6 +57,7 @@ services:
5557
build:
5658
context: ./stk-engine-py310
5759
args:
58-
baseImage: ansys/stk:latest-centos7-pybase
60+
baseImage: ansys/stk:latest-centos7
61+
basePythonImage: ansys/stk:latest-centos7-pybase
5962
environment:
6063
- ANSYSLMD_LICENSE_FILE=$ANSYSLMD_LICENSE_FILE

docker/linux/stk-engine-py310/Dockerfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# By default, start from the base STK Engine Python image
2-
ARG baseImage=ansys/stk:latest-centos7-pybase
3-
FROM ${baseImage} as builder
2+
ARG baseImage=ansys/stk:latest-centos7
3+
ARG basePythonImage=ansys/stk:latest-centos7-pybase
4+
FROM ${basePythonImage} as builder
45

56
##############################################
67
# 1) Build Python into its own builder stage
@@ -21,10 +22,12 @@ RUN cd /tmp && \
2122
#############################################################
2223

2324
# Switch back to non-root user
24-
ARG baseImage=ansys/stk:latest-centos7
2525
FROM ${baseImage}
26+
USER root
2627

28+
# Copy the Python interpreter, the standard library and pip to the final image
2729
COPY --from=builder /usr/local/bin/python3.10 /usr/local/bin/python3.10
30+
COPY --from=builder /usr/local/lib/python3.10 /usr/local/lib/python3.10
2831
COPY --from=builder /usr/local/bin/pip3.10 /usr/local/bin/pip3.10
2932

3033
RUN ln -sfn /usr/local/bin/python3.10 /usr/bin/python && \

docker/linux/stk-engine-py310/docker-compose.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ services:
66
build:
77
context: .
88
args:
9-
baseImage: ansys/stk:latest-centos7-pybase
9+
baseImage: ansys/stk:latest-centos7
10+
basePythonImage: ansys/stk:latest-centos7-pybase
1011
environment:
1112
- ANSYSLMD_LICENSE_FILE=$ANSYSLMD_LICENSE_FILE

docker/linux/stk-engine-py38/Dockerfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# By default, start from the base STK Engine Python image
2-
ARG baseImage=ansys/stk:latest-centos7-pybase
3-
FROM ${baseImage} as builder
2+
ARG baseImage=ansys/stk:latest-centos7
3+
ARG basePythonImage=ansys/stk:latest-centos7-pybase
4+
FROM ${basePythonImage} as builder
45

56
##############################################
67
# 1) Build Python into its own builder stage
@@ -21,10 +22,12 @@ RUN cd /tmp && \
2122
#############################################################
2223

2324
# Switch back to non-root user
24-
ARG baseImage=ansys/stk:latest-centos7
2525
FROM ${baseImage}
26+
USER root
2627

28+
# Copy the Python interpreter, the standard library and pip to the final image
2729
COPY --from=builder /usr/local/bin/python3.8 /usr/local/bin/python3.8
30+
COPY --from=builder /usr/local/lib/python3.8 /usr/local/lib/python3.8
2831
COPY --from=builder /usr/local/bin/pip3.8 /usr/local/bin/pip3.8
2932

3033
RUN ln -sfn /usr/local/bin/python3.8 /usr/bin/python && \

docker/linux/stk-engine-py38/docker-compose.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ services:
66
build:
77
context: .
88
args:
9-
baseImage: ansys/stk:latest-centos7-pybase
9+
baseImage: ansys/stk:latest-centos7
10+
basePythonImage: ansys/stk:latest-centos7-pybase
11+
environment:
12+
- ANSYSLMD_LICENSE_FILE=$ANSYSLMD_LICENSE_FILE
1013
environment:
1114
- ANSYSLMD_LICENSE_FILE=$ANSYSLMD_LICENSE_FILE

docker/linux/stk-engine-py39/Dockerfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# By default, start from the base STK Engine Python image
2-
ARG baseImage=ansys/stk:latest-centos7-pybase
3-
FROM ${baseImage} as builder
2+
ARG baseImage=ansys/stk:latest-centos7
3+
ARG basePythonImage=ansys/stk:latest-centos7-pybase
4+
FROM ${basePythonImage} as builder
45

56
##############################################
67
# 1) Build Python into its own builder stage
@@ -21,10 +22,12 @@ RUN cd /tmp && \
2122
#############################################################
2223

2324
# Switch back to non-root user
24-
ARG baseImage=ansys/stk:latest-centos7
2525
FROM ${baseImage}
26+
USER root
2627

28+
# Copy the Python interpreter, the standard library and pip to the final image
2729
COPY --from=builder /usr/local/bin/python3.9 /usr/local/bin/python3.9
30+
COPY --from=builder /usr/local/lib/python3.9 /usr/local/lib/python3.9
2831
COPY --from=builder /usr/local/bin/pip3.9 /usr/local/bin/pip3.9
2932

3033
RUN ln -sfn /usr/local/bin/python3.9 /usr/bin/python && \

docker/linux/stk-engine-py39/docker-compose.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ services:
66
build:
77
context: .
88
args:
9-
baseImage: ansys/stk:latest-centos7-pybase
9+
baseImage: ansys/stk:latest-centos7
10+
basePythonImage: ansys/stk:latest-centos7-pybase
1011
environment:
1112
- ANSYSLMD_LICENSE_FILE=$ANSYSLMD_LICENSE_FILE

0 commit comments

Comments
 (0)