Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option for selecting the architecture of processor for arm container images #43

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

# https://releases.openstack.org/wallaby/index.html

ARG ARCHITECTURE=x86_64

FROM python:3.9-slim-bullseye as builder

ENV SWIFT_VERSION=2.27.0
Expand Down Expand Up @@ -60,6 +62,8 @@ RUN --mount=type=cache,target=/root/.cache/pip \

FROM python:3.9-slim-bullseye

ARG ARCHITECTURE

ENV S6_LOGGING=1
ENV S6_VERSION=3.1.5.0

Expand Down Expand Up @@ -94,14 +98,14 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
# Install s6
ADD https://github.com/just-containers/s6-overlay/releases/download/v$S6_VERSION/s6-overlay-noarch.tar.xz /tmp
ADD https://github.com/just-containers/s6-overlay/releases/download/v$S6_VERSION/s6-overlay-noarch.tar.xz.sha256 /tmp
ADD https://github.com/just-containers/s6-overlay/releases/download/v$S6_VERSION/s6-overlay-x86_64.tar.xz /tmp/
ADD https://github.com/just-containers/s6-overlay/releases/download/v$S6_VERSION/s6-overlay-x86_64.tar.xz.sha256 /tmp/
ADD https://github.com/just-containers/s6-overlay/releases/download/v$S6_VERSION/s6-overlay-${ARCHITECTURE}.tar.xz /tmp/
ADD https://github.com/just-containers/s6-overlay/releases/download/v$S6_VERSION/s6-overlay-${ARCHITECTURE}.tar.xz.sha256 /tmp/
ADD https://github.com/just-containers/s6-overlay/releases/download/v$S6_VERSION/syslogd-overlay-noarch.tar.xz /tmp/
ADD https://github.com/just-containers/s6-overlay/releases/download/v$S6_VERSION/syslogd-overlay-noarch.tar.xz.sha256 /tmp/

RUN cd /tmp \
&& sha256sum -c *.sha256 \
&& tar -C / -Jxpf /tmp/s6-overlay-x86_64.tar.xz \
&& tar -C / -Jxpf /tmp/s6-overlay-${ARCHITECTURE}.tar.xz \
&& tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz \
&& tar -C / -Jxpf /tmp/syslogd-overlay-noarch.tar.xz \
&& rm -rf /tmp/s6-overlay* \
Expand All @@ -116,10 +120,10 @@ COPY --from=builder /usr/local/include /usr/local/include
COPY --from=builder /usr/local/lib /usr/local/lib

# Prepare
RUN useradd -U swift \
&& useradd -U keystone \
&& useradd -U syslog \
&& useradd -U sysllog \
RUN useradd -U swift \
&& useradd -U keystone \
&& useradd -U syslog \
&& useradd -U sysllog \
&& mkdir -p "/etc/swift" "/srv/node" "/srv/node/sdb1" "/var/cache/swift" "/var/run/swift" "/usr/local/src/" \
&& mkdir -p "/etc/keystone" "/var/lib/keystone" "/etc/keystone/fernet-keys/" \
# Build swift rings
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ Build the image with

docker buildx build -t keystone-swift .

Or for using arm processor architecture, like for Mac's M1.

docker buildx build --build-arg="ARCHITECTURE=aarch64" -t keystone-swift .

Start the container using the following command:

docker run -d --init -p 5000:5000 -p 8080:8080 --name keystone-swift keystone-swift
Expand Down
Loading