Update docker_build.sh
This commit is contained in:
parent
94a9146476
commit
91f6cb2957
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,6 +2,7 @@
|
||||
output
|
||||
sources
|
||||
sysroot
|
||||
.docker_context
|
||||
|
||||
# General
|
||||
.DS_Store
|
||||
|
@ -6,18 +6,19 @@ LABEL org.opencontainers.image.url="https://github.com/llamasoft/static-builder"
|
||||
|
||||
# This is all that's required for the build process.
|
||||
# Some packages are already installed but are included for completeness.
|
||||
RUN apt-get update \
|
||||
RUN apt-get update && apt-get upgrade -y \
|
||||
&& apt-get install -y \
|
||||
gcc g++ \
|
||||
make autoconf automake libtool patch \
|
||||
flex bison \
|
||||
wget \
|
||||
curl \
|
||||
tar gzip bzip2 xz-utils
|
||||
|
||||
RUN mkdir -p "/build"
|
||||
RUN mkdir -p "/build" && chown 1000:1000 /build
|
||||
COPY "Makefile" "/build/"
|
||||
COPY "include" "/build/include"
|
||||
VOLUME "/build"
|
||||
|
||||
WORKDIR "/build"
|
||||
USER 1000
|
||||
ENTRYPOINT ["/usr/bin/make", "-w"]
|
||||
|
3
Makefile
3
Makefile
@ -312,6 +312,7 @@ clean: mostlyclean
|
||||
ifneq (,$(TARGET))
|
||||
- $(RM) -r "$(OUTPUT)"
|
||||
- $(RM) -r "$(SYSROOT)"
|
||||
- $(RM) -r "$(MAKEFILE_DIR)/docker_context"
|
||||
else
|
||||
- $(RM) -r "$(OUTPUT_ROOT)"
|
||||
- $(RM) -r "$(TOOLCHAIN_ROOT)"
|
||||
@ -332,4 +333,4 @@ endif
|
||||
$(info $(subst : ,,$(call activate_toolchain)))
|
||||
$(info LDFLAGS='$(LDFLAGS)')
|
||||
$(info CFLAGS='$(CFLAGS)')
|
||||
$(info CXXFLAGS='$(CXXFLAGS)')
|
||||
$(info CXXFLAGS='$(CXXFLAGS)')
|
||||
|
@ -4,6 +4,10 @@
|
||||
# Any arguments supported by make are supported here.
|
||||
# Example: ./docker_build.sh -j TARGET=arm-linux-musleabi all
|
||||
set -e
|
||||
|
||||
docker build -t static-builder .
|
||||
docker run -it -v "${PWD}/output":"/build/output" --rm static-builder "$@"
|
||||
if [ -e .docker_context ]; then
|
||||
rm -r .docker_context/*
|
||||
fi
|
||||
mkdir -p .docker_context
|
||||
cp -r Dockerfile Makefile include .docker_context
|
||||
docker build -t static-builder .docker_context
|
||||
docker run -it -v "${PWD}/output":"/build/output:Z" -v "${PWD}/sources":"/build/sources:Z" --rm static-builder "$@"
|
||||
|
Loading…
x
Reference in New Issue
Block a user