forked from localstack/localstack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.rh
68 lines (55 loc) · 2.43 KB
/
Dockerfile.rh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Disclaimer: This Dockerfile is used to regularly test compatibility with RedHat based images.
# It is _not_ the usually Dockerfile and currently _not_ officially supported.
FROM redhat/ubi8
LABEL authors="LocalStack Contributors"
LABEL maintainer="LocalStack Team (info@localstack.cloud)"
LABEL description="LocalStack Docker image"
RUN dnf install -y cyrus-sasl-devel gcc gcc-c++ git iputils make npm openssl-devel procps zip \
&& dnf clean all \
&& rm -rf /var/cache/yum
RUN dnf install -y bzip2-devel sqlite-devel libffi-devel \
&& curl https://www.python.org/ftp/python/3.10.8/Python-3.10.8.tgz -o Python-3.10.8.tgz \
&& tar xzf Python-3.10.8.tgz \
&& cd Python-3.10.8 \
&& ./configure \
&& make -j $(nproc) \
&& make install \
&& cd .. \
&& rm -rf Python-3.10.8 \
&& rm Python-3.10.8.tgz \
&& dnf remove -y bzip2-devel sqlite-devel libffi-devel \
&& dnf clean all \
&& rm -rf /var/cache/yum
RUN python3 -m pip install -U setuptools pip wheel supervisor
# Create a localstack user
RUN useradd -ms /bin/bash localstack
# install entrypoint script
ADD bin/docker-entrypoint.sh /usr/local/bin/
# add the script to start LocalStack, the supervisor.d config, and the tmp dir marker
RUN mkdir -p /opt/code/localstack/bin/ && mkdir -p /tmp/localstack && touch /tmp/localstack/.marker
WORKDIR /opt/code/localstack/
ADD bin/localstack /opt/code/localstack/bin/
ADD bin/supervisord.conf /etc/supervisord.conf
# Create the venv
RUN python3 -m venv .venv
# Install python packages
RUN source .venv/bin/activate && python3 -m pip install supervisor awscli awscli-local --upgrade --no-cache-dir
# Install localstack dev packages
RUN source .venv/bin/activate && python3 -m pip install 'localstack[full]>=1.2.0' 'localstack-ext[full]>=1.2.0' --pre --upgrade --no-cache-dir
# Install the basic libraries
RUN source .venv/bin/activate && python3 -m localstack.services.install libs
# Set default settings
ENV USER=localstack
ENV PYTHONUNBUFFERED=1
ENV EDGE_BIND_HOST=0.0.0.0
ENV LOCALSTACK_HOSTNAME=localhost
# Add the build date and git hash at last (changes everytime)
ARG LOCALSTACK_BUILD_DATE
ARG LOCALSTACK_BUILD_GIT_HASH
ENV LOCALSTACK_BUILD_DATE=${LOCALSTACK_BUILD_DATE}
ENV LOCALSTACK_BUILD_GIT_HASH=${LOCALSTACK_BUILD_GIT_HASH}
# expose ports
EXPOSE 4510-4559 4566
HEALTHCHECK --interval=10s --start-period=15s --retries=5 --timeout=5s CMD ./bin/localstack status services
# define command at startup
ENTRYPOINT ["docker-entrypoint.sh"]