Skip to content

Commit

Permalink
update dockerfile for linux builds (#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke Gehorsam authored Mar 8, 2024
1 parent e12f9aa commit 8109dfb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
12 changes: 10 additions & 2 deletions scripts/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# syntax=docker/dockerfile:1.4
ARG UBUNTU_BASE=ubuntu:18.04
ARG UBUNTU_BASE=ubuntu:20.04
FROM $UBUNTU_BASE

ENV DEBIAN_FRONTEND=noninteractive

RUN rm -f /etc/apt/apt.conf.d/docker-clean; echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
RUN --mount=type=cache,target=/var/cache/apt --mount=type=cache,target=/var/lib/apt \
apt update && apt-get install --no-install-recommends -y libc-dev curl zip unzip ca-certificates busybox git-core pkg-config software-properties-common
apt update && apt-get install --no-install-recommends -y libc-dev curl zip unzip ca-certificates busybox git-core pkg-config software-properties-common make

RUN --mount=type=cache,target=/var/cache/apt --mount=type=cache,target=/var/lib/apt <<EOT bash -ue
mkdir -p /opt/cmake /opt/ninja
Expand All @@ -16,6 +18,12 @@ RUN --mount=type=cache,target=/var/cache/apt --mount=type=cache,target=/var/lib/
apt install -y g++-11 python3-distutils
EOT

RUN <<EOT bash -ue
git clone https://github.com/microsoft/vcpkg.git
EOT

ENV VCPKG_ROOT=/vcpkg

ARG CMAKE_ARGS=""

ENV CC=/usr/bin/gcc-11 CXX=/usr/bin/g++-11
Expand Down
4 changes: 1 addition & 3 deletions scripts/build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/bin/sh



exec docker build -f $(dirname $0)/Dockerfile --progress=plain $(dirname $0)/.. --output ${1:?pass output directory as first argument}
exec docker buildx build --platform linux/amd64 -f $(dirname $0)/Dockerfile --progress=tty $(dirname $0)/.. --output ${1:?pass output directory as first argument}

0 comments on commit 8109dfb

Please sign in to comment.