Skip to content

Commit

Permalink
Optimize Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
MahdiBM committed Jan 5, 2025
1 parent 9d92360 commit fae6ffa
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
# ================================
# Build image
# ================================
FROM swift:6.0-jammy as build
FROM ubuntu:jammy as build

ARG SWIFT_CONFIGURATION
ARG EXEC_NAME

# Install OS updates
RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true \
&& apt-get -q update \
&& apt-get -q dist-upgrade -y \
&& apt-get install -y libjemalloc-dev

WORKDIR /staging

# Copy .build to staging area
Expand All @@ -21,7 +15,7 @@ COPY .build ./.build
RUN mv .build/$SWIFT_CONFIGURATION/$EXEC_NAME ./

# Copy static swift backtracer binary to staging area
RUN cp "/usr/libexec/swift/linux/swift-backtrace-static" ./
COPY "/usr/libexec/swift/linux/swift-backtrace-static" ./

# Copy resources bundled by SPM to staging area
RUN find -L ".build/$SWIFT_CONFIGURATION/" -regex '.*\.resources$' -exec cp -Ra {} ./ \;
Expand Down

0 comments on commit fae6ffa

Please sign in to comment.