Skip to content

Commit

Permalink
Add extra utils (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
agouin authored Feb 23, 2023
1 parent ce7383a commit 5fb0d81
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 31 deletions.
25 changes: 20 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM --platform=$BUILDPLATFORM alpine:3 AS busybox-min
FROM --platform=$BUILDPLATFORM alpine:3 AS build-env

RUN apk add --no-cache \
RUN apk add --update --no-cache \
bash \
curl \
eudev-dev \
Expand All @@ -9,7 +9,12 @@ RUN apk add --no-cache \
libc-dev \
linux-headers \
make \
wget
wget \
bison \
flex \
automake \
autoconf \
libtool

ARG TARGETARCH
ARG BUILDARCH
Expand Down Expand Up @@ -44,20 +49,30 @@ RUN if [ "${TARGETARCH}" = "arm64" ] && [ "${BUILDARCH}" != "arm64" ]; then \
fi; \
make

# Static jq
WORKDIR /
RUN git clone --recursive -b jq-1.6 --single-branch https://github.com/stedolan/jq.git
WORKDIR /jq
RUN autoreconf -fi;\
./configure --with-oniguruma=builtin;\
make LDFLAGS=-all-static

FROM boxboat/config-merge:latest as config-merge

FROM alpine:3

RUN apk add --no-cache \
curl \
jq \
lz4 \
nano \
npm \
wget

# Install busybox
COPY --from=busybox-min /busybox/busybox /busybox/busybox
COPY --from=build-env /busybox/busybox /busybox/busybox

# Install jq
COPY --from=build-env /jq/jq /usr/local/bin/jq

# Add config-merge
COPY --from=config-merge /usr/local/config-merge /usr/local/config-merge
Expand Down
42 changes: 21 additions & 21 deletions busybox.min.config
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ CONFIG_FEATURE_TAR_NOPRESERVE_TIME=y
#
# CONFIG_FEATURE_TIMEZONE is not set
# CONFIG_FEATURE_PRESERVE_HARDLINKS is not set
# CONFIG_FEATURE_HUMAN_READABLE is not set
CONFIG_FEATURE_HUMAN_READABLE=y
# CONFIG_BASENAME is not set
CONFIG_CAT=y
# CONFIG_FEATURE_CATN is not set
Expand All @@ -217,17 +217,17 @@ CONFIG_CAT=y
# CONFIG_FEATURE_CP_REFLINK is not set
# CONFIG_CUT is not set
# CONFIG_FEATURE_CUT_REGEX is not set
# CONFIG_DATE is not set
# CONFIG_FEATURE_DATE_ISOFMT is not set
# CONFIG_FEATURE_DATE_NANO is not set
# CONFIG_FEATURE_DATE_COMPAT is not set
CONFIG_DATE=y
CONFIG_FEATURE_DATE_ISOFMT=y
CONFIG_FEATURE_DATE_NANO=y
CONFIG_FEATURE_DATE_COMPAT=y
# CONFIG_DD is not set
# CONFIG_FEATURE_DD_SIGNAL_HANDLING is not set
# CONFIG_FEATURE_DD_THIRD_STATUS_LINE is not set
# CONFIG_FEATURE_DD_IBS_OBS is not set
# CONFIG_FEATURE_DD_STATUS is not set
# CONFIG_DF is not set
# CONFIG_FEATURE_DF_FANCY is not set
CONFIG_DF=y
CONFIG_FEATURE_DF_FANCY=y
# CONFIG_FEATURE_SKIP_ROOTFS is not set
# CONFIG_DIRNAME is not set
# CONFIG_DOS2UNIX is not set
Expand All @@ -244,8 +244,8 @@ CONFIG_ENV=y
# CONFIG_FACTOR is not set
# CONFIG_FALSE is not set
# CONFIG_FOLD is not set
# CONFIG_HEAD is not set
# CONFIG_FEATURE_FANCY_HEAD is not set
CONFIG_HEAD=y
CONFIG_FEATURE_FANCY_HEAD=y
# CONFIG_HOSTID is not set
# CONFIG_ID is not set
# CONFIG_GROUPS is not set
Expand All @@ -264,11 +264,11 @@ CONFIG_FEATURE_LS_TIMESTAMPS=y
CONFIG_FEATURE_LS_USERNAME=y
CONFIG_FEATURE_LS_COLOR=y
CONFIG_FEATURE_LS_COLOR_IS_DEFAULT=y
# CONFIG_MD5SUM is not set
# CONFIG_SHA1SUM is not set
# CONFIG_SHA256SUM is not set
# CONFIG_SHA512SUM is not set
# CONFIG_SHA3SUM is not set
CONFIG_MD5SUM=y
CONFIG_SHA1SUM=y
CONFIG_SHA256SUM=y
CONFIG_SHA512SUM=y
CONFIG_SHA3SUM=y
# CONFIG_FEATURE_MD5_SHA1_SUM_CHECK is not set
# CONFIG_MKDIR is not set
# CONFIG_MKFIFO is not set
Expand All @@ -293,7 +293,7 @@ CONFIG_PWD=y
# CONFIG_SHRED is not set
# CONFIG_SHUF is not set
CONFIG_SLEEP=y
# CONFIG_FEATURE_FANCY_SLEEP is not set
CONFIG_FEATURE_FANCY_SLEEP=y
# CONFIG_SORT is not set
# CONFIG_FEATURE_SORT_BIG is not set
# CONFIG_FEATURE_SORT_OPTIMIZE_MEMORY is not set
Expand All @@ -302,14 +302,14 @@ CONFIG_SLEEP=y
# CONFIG_STAT is not set
# CONFIG_FEATURE_STAT_FORMAT is not set
# CONFIG_FEATURE_STAT_FILESYSTEM is not set
# CONFIG_STTY is not set
CONFIG_STTY=y
# CONFIG_SUM is not set
# CONFIG_SYNC is not set
# CONFIG_FEATURE_SYNC_FANCY is not set
# CONFIG_FSYNC is not set
# CONFIG_TAC is not set
# CONFIG_TAIL is not set
# CONFIG_FEATURE_FANCY_TAIL is not set
CONFIG_TAIL=y
CONFIG_FEATURE_FANCY_TAIL=y
CONFIG_TEE=y
# CONFIG_FEATURE_TEE_USE_BLOCK_IO is not set
# CONFIG_TEST is not set
Expand All @@ -319,7 +319,7 @@ CONFIG_TEE=y
# CONFIG_TIMEOUT is not set
# CONFIG_TOUCH is not set
# CONFIG_FEATURE_TOUCH_SUSV3 is not set
# CONFIG_TR is not set
CONFIG_TR=y
# CONFIG_FEATURE_TR_CLASSES is not set
# CONFIG_FEATURE_TR_EQUIV is not set
# CONFIG_TRUE is not set
Expand Down Expand Up @@ -380,7 +380,7 @@ CONFIG_DEFAULT_SETFONT_DIR=""
# CONFIG_START_STOP_DAEMON is not set
# CONFIG_FEATURE_START_STOP_DAEMON_LONG_OPTIONS is not set
# CONFIG_FEATURE_START_STOP_DAEMON_FANCY is not set
# CONFIG_WHICH is not set
CONFIG_WHICH=y

#
# klibc-utils
Expand Down Expand Up @@ -1057,7 +1057,7 @@ CONFIG_FEATURE_MIME_CHARSET=""
# CONFIG_FEATURE_TOPMEM is not set
# CONFIG_UPTIME is not set
# CONFIG_FEATURE_UPTIME_UTMP_SUPPORT is not set
# CONFIG_WATCH is not set
CONFIG_WATCH=y

#
# Runit Utilities
Expand Down
25 changes: 20 additions & 5 deletions native.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM alpine:3 AS busybox-min
FROM alpine:3 AS build-env

RUN apk add --no-cache \
RUN apk add --update --no-cache \
bash \
curl \
eudev-dev \
Expand All @@ -9,7 +9,12 @@ RUN apk add --no-cache \
libc-dev \
linux-headers \
make \
wget
wget \
bison \
flex \
automake \
autoconf \
libtool

# Build minimal busybox
WORKDIR /
Expand All @@ -19,20 +24,30 @@ WORKDIR /busybox
ADD busybox.min.config .config
RUN make

# Static jq
WORKDIR /
RUN git clone --recursive -b jq-1.6 --single-branch https://github.com/stedolan/jq.git
WORKDIR /jq
RUN autoreconf -fi;\
./configure --with-oniguruma=builtin;\
make LDFLAGS=-all-static

FROM boxboat/config-merge:latest as config-merge

FROM alpine:3

RUN apk add --no-cache \
curl \
jq \
lz4 \
nano \
npm \
wget

# Install busybox
COPY --from=busybox-min /busybox/busybox /busybox/busybox
COPY --from=build-env /busybox/busybox /busybox/busybox

# Install jq
COPY --from=build-env /jq/jq /usr/local/bin/jq

# Add config-merge
COPY --from=config-merge /usr/local/config-merge /usr/local/config-merge
Expand Down

0 comments on commit 5fb0d81

Please sign in to comment.