Compare commits
3 Commits
770a36cef6
...
a449fc6afd
Author | SHA1 | Date |
---|---|---|
Lance Vick | a449fc6afd | |
Lance Vick | d472f74fe8 | |
Lance Vick | 833df686d6 |
|
@ -1,7 +1,6 @@
|
|||
ARG REGISTRY=local
|
||||
from ${REGISTRY}/binutils as binutils
|
||||
from ${REGISTRY}/m4 as m4
|
||||
from ${REGISTRY}/lex as lex
|
||||
from ${REGISTRY}/gcc as gcc
|
||||
from ${REGISTRY}/musl as musl
|
||||
from ${REGISTRY}/make as make
|
||||
|
@ -13,10 +12,10 @@ from ${REGISTRY}/bison as bison
|
|||
from ${REGISTRY}/busybox as busybox
|
||||
|
||||
FROM busybox as base
|
||||
ENV SRC_VERSION=2.5.11
|
||||
ENV SRC_SITE=http://download.nust.na/pub2/openpkg1/sources/DST/flex/flex-2.5.11.tar.gz
|
||||
ENV SRC_HASH=bc79b890f35ca38d66ff89a6e3758226131e51ccbd10ef78d5ff150b7bd73689
|
||||
ENV SRC_FILE=flex-${SRC_VERSION}.tar.gz
|
||||
ENV VERSION=2.6.4
|
||||
ENV SRC_SITE=https://github.com/westes/flex/releases/download/v${VERSION}/flex-${VERSION}.tar.gz
|
||||
ENV SRC_HASH=e87aae032bf07c26f85ac0ed3250998c37621d95f8bd748b31f15b33c45ee995
|
||||
ENV SRC_FILE=flex-${VERSION}.tar.gz
|
||||
|
||||
FROM base as fetch
|
||||
RUN set -eux; \
|
||||
|
@ -36,6 +35,7 @@ COPY --from=automake . /
|
|||
COPY --from=bison . /
|
||||
COPY --from=gettext . /
|
||||
COPY --from=musl . /
|
||||
|
||||
RUN set -eux; \
|
||||
./autogen.sh; \
|
||||
./configure \
|
||||
|
@ -44,10 +44,8 @@ RUN set -eux; \
|
|||
--prefix=/usr \
|
||||
--bindir=/bin \
|
||||
--mandir=/usr/share/man \
|
||||
--infodir=/usr/share/info \
|
||||
--disable-shared \
|
||||
--disable-static; \
|
||||
make
|
||||
--infodir=/usr/share/info; \
|
||||
make LDFLAGS=-static
|
||||
|
||||
FROM build as install
|
||||
USER 0:0
|
||||
|
|
|
@ -1,40 +0,0 @@
|
|||
ARG REGISTRY=local
|
||||
FROM ${REGISTRY}/gcc:latest as gcc
|
||||
FROM ${REGISTRY}/binutils:latest as binutils
|
||||
FROM ${REGISTRY}/musl:latest as musl
|
||||
FROM ${REGISTRY}/make:latest as make
|
||||
FROM ${REGISTRY}/busybox:latest as busybox
|
||||
|
||||
FROM busybox as base
|
||||
COPY --from=gcc . /
|
||||
COPY --from=binutils . /
|
||||
COPY --from=make . /
|
||||
COPY --from=musl . /
|
||||
ENV SRC_VERSION 070527
|
||||
ENV SRC_FILE heirloom-devtools-${SRC_VERSION}.tar.bz2
|
||||
ENV SRC_SITE=http://downloads.sourceforge.net/project/heirloom/heirloom-devtools/${SRC_VERSION}/${SRC_FILE}
|
||||
ENV SRC_HASH=9f233d8b78e4351fe9dd2d50d83958a0e5af36f54e9818521458a08e058691ba
|
||||
|
||||
FROM base as fetch
|
||||
RUN wget ${SRC_SITE}
|
||||
RUN echo "${SRC_HASH} ${SRC_FILE}" | sha256sum -c
|
||||
|
||||
FROM fetch as build
|
||||
RUN tar -xjf ${SRC_FILE}
|
||||
WORKDIR heirloom-devtools-${SRC_VERSION}
|
||||
RUN set -eux; \
|
||||
make yacc/Makefile lex/Makefile; \
|
||||
make -C yacc LDFLAGS=-static; \
|
||||
make -C lex LDFLAGS=-static
|
||||
|
||||
FROM build as install
|
||||
USER 0:0
|
||||
RUN set -eux; \
|
||||
mkdir -p /rootfs/usr/bin; \
|
||||
install lex/lex /rootfs/usr/bin
|
||||
RUN find /rootfs -exec touch -hcd "@0" "{}" +
|
||||
|
||||
FROM scratch as package
|
||||
COPY --from=install /rootfs /
|
||||
ENTRYPOINT ["/usr/bin/lex"]
|
||||
CMD ["-V"]
|
|
@ -39,14 +39,13 @@ define build
|
|||
--platform $(PLATFORM) \
|
||||
--progress=plain \
|
||||
$(if $(filter latest,$(VERSION)),,--build-arg VERSION=$(VERSION)) \
|
||||
--output type=oci,force-compression=true,name=$(NAME),annotation.org.opencontainers.image.revision=$(REVISION),annotation.org.opencontainers.image.version=$(VERSION),dest=- \
|
||||
--output type=oci,force-compression=true,name=$(NAME),annotation.org.opencontainers.image.revision=$(REVISION),annotation.org.opencontainers.image.version=$(VERSION),dest=$(basename $@).tar \
|
||||
--target $(TARGET) \
|
||||
$(EXTRA_ARGS) \
|
||||
$(NOCACHE_FLAG) \
|
||||
src/$(CATEGORY)/$(NAME) \
|
||||
> $(basename $@).tar.tmp \
|
||||
&& gzip < $(basename $@).tar.tmp > $@ \
|
||||
&& rm $(basename $@).tar.tmp \
|
||||
&& gzip < $(basename $@).tar > $@ \
|
||||
&& rm $(basename $@).tar \
|
||||
&& gunzip -c $@ | docker load; \
|
||||
)
|
||||
$(eval TIMESTAMP := $(shell TZ=GMT date +"%Y-%m-%dT%H:%M:%SZ"))
|
||||
|
|
Reference in New Issue