Public Repository

Last pushed: a year ago
Short Description
radare2 on alpine-linux with glibc
Full Description

small image (34MB) with radare2 tools from alpine testing repository.
lauches r2 on an empty file by default.

Dockerfile :

#
# radare2 on alpine linux. this image should weight 33 MB
# http://radare.org http://alpinelinux.org
#
# the alpine/glibc part is basically from frolvlad/alpine-glibc exept we need the edge repository
# note that the glibc packages are not from official sources
#
# the container lauches r2 on an empty file by default
#
# create ~/workdir on your host, move a binary there and run :
# docker run --rm -it -v ~/workdir:/workdir jolan/alpine-radare2 <binary>
#
# you can open a shell with (add --user root to open a root shell) :
# docker run --rm -it -v ~/workdir:/workdir --entrypoint sh jolan/alpine-radare2
#
# you can run other radare tools (eg rasm2 -d eb02) with :
# docker run --rm -it -v ~/workdir:/workdir --entrypoint rasm2 jolan/alpine-radare2 -d eb02
# or you can lauch it from r2 with : !rasm2 -d eb02

FROM alpine:edge

# Here we install GNU libc (aka glibc) and set C.UTF-8 locale as default.

RUN ALPINE_GLIBC_BASE_URL="https://github.com/andyshinn/alpine-pkg-glibc/releases/download" && \
    ALPINE_GLIBC_PACKAGE_VERSION="2.23-r1" && \
    ALPINE_GLIBC_BASE_PACKAGE_FILENAME="glibc-$ALPINE_GLIBC_PACKAGE_VERSION.apk" && \
    ALPINE_GLIBC_BIN_PACKAGE_FILENAME="glibc-bin-$ALPINE_GLIBC_PACKAGE_VERSION.apk" && \
    ALPINE_GLIBC_I18N_PACKAGE_FILENAME="glibc-i18n-$ALPINE_GLIBC_PACKAGE_VERSION.apk" && \
    apk add --no-cache --virtual=build-dependencies wget ca-certificates && \
    wget \
        "https://raw.githubusercontent.com/andyshinn/alpine-pkg-glibc/master/andyshinn.rsa.pub" \
        -O "/etc/apk/keys/andyshinn.rsa.pub" && \
    wget \
        "$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_BASE_PACKAGE_FILENAME" \
        "$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_BIN_PACKAGE_FILENAME" \
        "$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_I18N_PACKAGE_FILENAME" && \
    apk add --no-cache \
        "$ALPINE_GLIBC_BASE_PACKAGE_FILENAME" \
        "$ALPINE_GLIBC_BIN_PACKAGE_FILENAME" \
        "$ALPINE_GLIBC_I18N_PACKAGE_FILENAME" && \
    \
    rm "/etc/apk/keys/andyshinn.rsa.pub" && \
    /usr/glibc-compat/bin/localedef --force --inputfile POSIX --charmap UTF-8 C.UTF-8 || true && \
    echo "export LANG=C.UTF-8" > /etc/profile.d/locale.sh && \
    \
    apk del glibc-i18n && \
    \
    apk del build-dependencies && \
    rm \
        "$ALPINE_GLIBC_BASE_PACKAGE_FILENAME" \
        "$ALPINE_GLIBC_BIN_PACKAGE_FILENAME" \
        "$ALPINE_GLIBC_I18N_PACKAGE_FILENAME"

ENV LANG=C.UTF-8

# Install radare2 from the edge/testing repository

RUN echo '@testing http://nl.alpinelinux.org/alpine/edge/testing' >> /etc/apk/repositories && \
        apk add --update radare2@testing && \
        rm -rf /var/cache/apk/*

# add an unprivileged user
RUN adduser -s /sbin/nologin -D nonroot

USER nonroot
WORKDIR /workdir
ENTRYPOINT ["r2"]
CMD ["--"]
Docker Pull Command
Owner
jolan

Comments (0)