专属域名
文档搜索
轩辕助手
Run助手
邀请有礼
返回顶部
快速返回页面顶部
收起
收起工具栏
轩辕镜像 官方专业版
轩辕镜像 官方专业版轩辕镜像 官方专业版官方专业版
首页个人中心搜索镜像

交易
充值流量我的订单
工具
提交工单镜像收录一键安装
Npm 源Pip 源Homebrew 源
帮助
常见问题
其他
关于我们网站地图

官方QQ群: 1072982923

igeshosk/localstack Docker 镜像 - 轩辕镜像 | Docker 镜像高效稳定拉取服务

热门搜索:openclaw🔥nginx🔥redis🔥mysqlopenjdkcursorweb2apimemgraphzabbixetcdubuntucorednsjdk
localstack
igeshosk/localstack
自动构建
igeshosk
Fork of the original atlassian/localstack to fix issue with the SNS publish
下载次数: 0状态:自动构建维护者:igeshosk仓库类型:镜像最近更新:8 年前
使用轩辕镜像,把时间还给真正重要的事。点击查看
镜像简介版本下载
使用轩辕镜像,把时间还给真正重要的事。点击查看

![Build Status]([] ![Coverage Status]([] ![PyPI Version]([] ![PyPI License]([] ![Code Climate]([***]

LocalStack - A fully functional local AWS cloud stack

!LocalStack

Please note: The main version of this repository is [*] please raise PRs against that repo.**

LocalStack provides an easy-to-use test/mocking framework for developing Cloud applications.

Currently, the focus is primarily on supporting the AWS cloud stack.

LocalStack spins up the following core Cloud APIs on your local machine:

  • API Gateway at http://localhost:4567
  • Kinesis at http://localhost:4568
  • DynamoDB at http://localhost:4569
  • DynamoDB Streams at http://localhost:4570
  • Elasticsearch at http://localhost:4571
  • S3 at http://localhost:4572
  • Firehose at http://localhost:4573
  • Lambda at http://localhost:4574
  • SNS at http://localhost:4575
  • SQS at http://localhost:4576
  • Redshift at http://localhost:4577
  • ES (Elasticsearch Service) at http://localhost:4578
  • SES at http://localhost:4579
  • Route53 at http://localhost:4580
  • CloudFormation at http://localhost:4581
  • CloudWatch at http://localhost:4582

Additionally, LocalStack provides a powerful set of tools to interact with the cloud services, including a fully featured KCL Kinesis client with Python binding, simple setup/teardown integration for nosetests, as well as an Environment abstraction that allows to easily switch between local and remote Cloud execution.

Why LocalStack?

LocalStack builds on existing best-of-breed mocking/testing tools, most notably kinesalite/dynalite and moto. While these tools are awesome (!), they lack functionality for certain use cases. LocalStack combines the tools, makes them interoperable, and adds important missing functionality on top of them:

  • Error injection: LocalStack allows to inject errors frequently occurring in real Cloud environments, for instance ProvisionedThroughputExceededException which is thrown by Kinesis or DynamoDB if the amount of read/write throughput is exceeded.
  • Actual HTTP REST services: All services in LocalStack allow actual HTTP connections on a TCP port. In contrast, moto uses boto client proxies that are injected into all methods annotated with @mock_sqs. These client proxies do not perform an actual REST call, but rather call a local mock service method that lives in the same process as the test code.
  • Language agnostic: Although LocalStack is written in Python, it works well with arbitrary programming languages and environments, due to the fact that we are using the actual REST APIs via HTTP.
  • Isolated processes: All services in LocalStack run in separate processes. The overhead of additional processes is negligible, and the entire stack can easily be executed on any developer machine and CI server. In moto, components are often hard-wired in RAM (e.g., when forwarding a message on an SNS topic to an SQS queue, the queue endpoint is looked up in a local hash map). In contrast, LocalStack services live in isolation (separate processes available via HTTP), which fosters true decoupling and more closely resembles the real cloud environment.
  • Pluggable services: All services in LocalStack are easily pluggable (and replaceable), due to the fact that we are using isolated processes for each service. This allows us to keep the framework up-to-date and select best-of-breed mocks for each individual service (e.g., kinesalite is much more advanced than its moto counterpart).

Requirements

  • make
  • python (both Python 2.x and 3.x supported)
  • pip (python package manager)
  • npm (node.js package manager)
  • java/javac (Java 8 runtime environment and compiler)
  • mvn (Maven, the build system for Java)

Installing

The easiest way to install LocalStack is via pip:

pip install localstack

Once installed, run the infrastructure using the following command:

localstack start

Running in Docker

You can also spin up LocalStack in Docker:

localstack start --docker

Or using docker-compose (you need to clone the repository first):

docker-compose up

(Note that on MacOS you may have to run TMPDIR=/private$TMPDIR docker-compose up if $TMPDIR contains a symbolic link that cannot be mounted by Docker.)

Configurations

You can pass the following environment variables to LocalStack:

  • SERVICES: Comma-separated list of service names and (optional) ports they should run on. If no port is specified, a default port is used. Service names basically correspond to the service names of the AWS CLI (kinesis, lambda, sqs, etc), although LocalStack only supports a subset of them. Example value: kinesis,lambda:4569,sqs:4570 to start Kinesis on the default port, Lambda on port 4569, and SQS on port 4570.
  • DEFAULT_REGION: AWS region to use when talking to the API (defaults to us-east-1).
  • HOSTNAME: If you need to expose your services on a specific host (defaults to localhost).
  • USE_SSL: Whether to use [***] URLs with SSL encryption (defaults to false).
  • KINESIS_ERROR_PROBABILITY: Decimal value between 0.0 (default) and 1.0 to randomly inject ProvisionedThroughputExceededException errors into Kinesis API responses.
  • DYNAMODB_ERROR_PROBABILITY: Decimal value between 0.0 (default) and 1.0 to randomly inject ProvisionedThroughputExceededException errors into DynamoDB API responses.
  • LAMBDA_EXECUTOR: Method to use for executing Lambda functions. Valid values are local (run the code in a temporary directory on the local machine) or docker (run code in a separate Docker container). In the latter case, if LocalStack itself is started inside Docker, then the docker command needs to be available inside the container (usually requires to run the container in privileged mode). Default is docker, fallback to local if Docker is not available.
  • LAMBDA_REMOTE_DOCKER:
    • when set to false (default): your lambda functions definitions will be passed to the container by mounting the volume (potentially faster) It is mandatory to have the Docker client and the Docker host on the same machine
    • when set to true: your lambda functions definitions will be passed to the container by copying the zip file (potentially slower). It allows for remote execution, where the host and the client are not on the same machine
  • DATA_DIR: Local directory for saving persistent data (currently only supported for these services: Kinesis, DynamoDB, Elasticsearch). Set it to /tmp/localstack/data to enable persistence (/tmp/localstack is mounted into the Docker container), leave blank to disable persistence (default).

Accessing the infrastructure via CLI or code

You can point your aws CLI to use the local infrastructure, for example:

aws --endpoint-url=http://localhost:4568 kinesis list-streams
{
    "StreamNames": []
}

If you are accessing the cloud APIs from within yout Python code, you can also use boto3 and use the endpoint_url parameter to connect to the respective service on localhost. See localstack.utils.aws.aws_stack for convenience methods to connect to the local services.

Integration with nosetests

If you want to use LocalStack in your integration tests (e.g., nosetests), simply fire up the infrastructure in your test setup method and then clean up everything in your teardown method:

from localstack.mock import infra

def setup():
    infra.start_infra(async=True)

def teardown():
    infra.stop_infra()

def my_app_test():
    # here goes your test logic

See the example test file tests/test_integration.py for more details.

Integration with Java/JUnit

In order to use LocalStack with Java, the project ships with a simple JUnit runner. Take a look at the example JUnit test in ext/java. When you run the test, all dependencies are automatically downloaded and installed to a temporary directory in your system.

@RunWith(LocalstackTestRunner.class)
public class MyCloudAppTest {

  @Test
  public void testLocalS3API() {
    AmazonS3 s3 = new AmazonS3Client(...);
    s3.setEndpoint(LocalstackTestRunner.getEndpointS3());
    List<Bucket> buckets = s3.listBuckets();
    ...
  }

}

The LocalStack JUnit test runner is published as a Maven artifact in the Bitbucket repository. Simply add the following configuration to your pom.xml file:

<project ...>
  ...
  <dependencies>
    ...
    <dependency>
      <groupId>com.atlassian</groupId>
      <artifactId>localstack-utils</artifactId>
      <version>1.0-SNAPSHOT</version>
    </dependency>
  </dependencies>

  <repositories>
    <repository>
      <id>localstack-repo</id>
      <url>[***]</url>
    </repository>
  </repositories>

</project>
Troubleshooting
  • If you're using AWS Java libraries with Kinesis, please, refer to CBOR protocol issues with the Java SDK guide how to disable CBOR protocol which is not supported by kinesalite.

  • Accessing local S3 from Java: To avoid domain name resolution issues, you need to enable path style access on your client:

s3.setS3ClientOptions(S3ClientOptions.builder().setPathStyleAccess(true).build());
// There is also an option to do this if you're using any of the client builder classes:
AmazonS3ClientBuilder builder = AmazonS3ClientBuilder.standard();
builder.withPathStyleAccessEnabled(true);
...
  • Mounting the temp. directory: Note that on MacOS you may have to run TMPDIR=/private$TMPDIR docker-compose up if $TMPDIR contains a symbolic link that cannot be mounted by Docker. (See details here: [***]

Developing

If you pull the repo in order to extend/modify LocalStack, run this command to install all the dependencies:

make install

This will install the required pip dependencies in a local Python virtualenv directory .venv (your global python packages will remain untouched), as well as some node modules in ./localstack/node_modules/. Depending on your system, some pip/npm modules may require additional native libs installed.

The Makefile contains a target to conveniently run the local infrastructure for development:

make infra

Testing

The project contains a set of unit and integration tests that can be kicked off via a make target:

make test

Web Dashboard

The projects also comes with a simple Web dashboard that allows to view the deployed AWS components and the relationship between them.

localstack web

Change Log

  • v0.6.0: Load services as plugins; fix service default ports; fix SQS->SNS and MD5 of message attributes; fix Host header for S3
  • v0.5.5: Enable SSL encryption for all service endpoints (USE_SSL config); create Docker base image; fix issue with DATA_DIR
  • v0.5.4: Remove hardcoded /tmp/ for Windows-compat.; update CLI and docs; fix S3/SNS notifications; disable Elasticsearch compression
  • v0.5.3: Add CloudFormation support for serverless / API Gateway deployments; fix installation via pypi; minor fix for Java (passing of environment variables)
  • v0.5.0: Extend DynamoDB Streams API; fix keep-alive connection for S3; fix deadlock in nested Lambda executions; add integration SNS->Lambda; CloudFormation serverless example; replace dynalite with DynamoDBLocal; support Lambda execution in remote Docker container; fix CloudWatch metrics for Lambda invocation errors
  • v0.4.3: Initial support for CloudWatch metrics (for Lambda functions); HTTP forwards for API Gateway; fix S3 message body signatures; download Lambda archive from S3 bucket; fix/extend ES tests
  • v0.4.2: Initial support for Java Lambda functions; CloudFormation deployments; API Gateway tests
  • v0.4.1: Python 3 compatibility; data persistence; add seq. numbers in Kinesis events; limit Elasticsearch memory
  • v0.4.0: Execute Lambda functions in Docker containers; CORS headers for S3
  • v0.3.11: Add Route53, SES, CloudFormation; DynamoDB fault injection; UI tweaks; refactor config
  • v0.3.10: Add initial support for S3 bucket notifications; fix subprocess32 installation
  • v0.3.9: Make services/ports configurable via $SERVICES; add tests for Firehose+S3
  • v0.3.8: Fix Elasticsearch via local bind and proxy; refactoring; improve error logging
  • v0.3.5: Fix lambda handler name; fix host name for S3 API; install web libs on pip install
  • v0.3.4: Fix file permissions in build; fix and add UI to Docker image; add stub of ES API
  • v0.3.3: Add version tags to Docker images
  • v0.3.2: Add support for Redshift API; code refactoring
  • v0.3.1: Add Dockerfile and push image to Docker Hub
  • v0.3.0: Add simple integration for JUnit; improve process signal handling
  • v0.2.11: Refactored the AWS assume role function
  • v0.2.10: Added AWS assume role functionality.
  • v0.2.9: Kinesis error response formatting
  • v0.2.7: Throw Kinesis errors randomly
  • v0.2.6: Decouple SNS/SQS: intercept SNS calls and forward to subscribed SQS queues
  • v0.2.5: Return error response from Kinesis if flag is set
  • v0.2.4: Allow Lambdas to use file (import from file instead of exec'ing)
  • v0.2.3: Improve Kinesis/KCL auto-checkpointing (leases in DDB)
  • v0.2.0: Speed up installation time by lazy loading libraries
  • v0.1.19: Pass shard_id in records sent from KCL process
  • v0.1.16: Minor restructuring and refactoring (create separate kinesis_util.py)
  • v0.1.14: Fix AWS tokens when creating Elasticsearch client
  • v0.1.11: Add startup/initialization notification for KCL process
  • v0.1.10: Bump version of amazon_kclpy to 1.4.1
  • v0.1.9: Add initial support for SQS/SNS
  • v0.1.8: Fix installation of JARs in amazon_kclpy if localstack is installed transitively
  • v0.1.7: Bump version of amazon_kclpy to 1.4.0
  • v0.1.6: Add travis-ci and coveralls configuration
  • v0.1.5: Refactor Elasticsearch utils; fix bug in method to delete all ES indexes
  • v0.1.4: Enhance logging; extend java KCL credentials provider (support STS assumed roles)
  • v0.1.2: Add configurable KCL log output
  • v0.1.0: Initial release

Contributing

We welcome feedback, bug reports, and pull requests!

For pull requests, please stick to the following guidelines:

  • Add tests for any new features and bug fixes. Ideally, each PR should increase the test coverage.
  • Follow the existing code style (e.g., indents). A PEP8 code linting target is included in the Makefile.
  • Put a reasonable amount of comments into the code.
  • Separate unrelated changes into multiple pull requests.

Please note that we need to collect a signed Contributors License Agreement from each individual developer who contributes code to this repository. Please refer to the following links:

  • [***]
  • [***]

License

Copyright (c) 2016 Atlassian and others.

LocalStack is released under the Apache License, Version 2.0 (see LICENSE.txt).

We build on a number of third-party software tools, with the following licenses:

Third-Party softwareLicense
Python/pip modules:
airspeedBSD License
amazon_kclpyAmazon Software License
boto3Apache License 2.0
coverageApache License 2.0
docoptMIT License
elasticsearchApache License 2.0
flaskBSD License
flask_swaggerMIT License
jsonpath-rwApache License 2.0
motoApache License 2.0
noseGNU LGPL
pep8Expat license
requestsApache License 2.0
shMIT License
subprocess32PSF License
Node.js/npm modules:
dynaliteMIT License
kinesaliteMIT License
Other tools:
ElasticsearchApache License 2.0
查看更多 localstack 相关镜像 →
LocalStack logo
LocalStack
extension
Extension of Localstack for Docker desktop
1万+ 次下载
27 天前更新
localstack/localstack logo
localstack/localstack
localstack
LocalStack是一款可在单个容器中运行的云服务模拟器,支持在本地离线运行AWS应用程序或Lambda函数,无需连接远程云提供商,加速云应用的测试与开发工作流程。
343 次收藏1亿+ 次下载
7 天前更新
localstack/localstack-light logo
localstack/localstack-light
localstack
LocalStack镜像(具有精简依赖集),已弃用 - 请改用localstack/localstack
7 次收藏100万+ 次下载
2 年前更新
localstack/localstack-full logo
localstack/localstack-full
localstack
LocalStack镜像,包含完整依赖集(已弃用 - 请改用localstack/localstack)
7 次收藏100万+ 次下载
2 年前更新
localstack/localstack-pro logo
localstack/localstack-pro
localstack
LocalStack Pro是一款易用的云模拟框架,适用于开发、测试和实验场景。
47 次收藏100万+ 次下载
7 天前更新
localstack/ami-amazonlinux logo
localstack/ami-amazonlinux
localstack
为LocalStack定制的Amazon Linux EC2 AMI(Amazon机器镜像),优化用于本地AWS服务模拟与开发测试。
10万+ 次下载
6 个月前更新

轩辕镜像配置手册

探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式

Docker 配置

登录仓库拉取

通过 Docker 登录认证访问私有仓库

专属域名拉取

无需登录使用专属域名

K8s Containerd

Kubernetes 集群配置 Containerd

K3s

K3s 轻量级 Kubernetes 镜像加速

Dev Containers

VS Code Dev Containers 配置

Podman

Podman 容器引擎配置

Singularity/Apptainer

HPC 科学计算容器配置

其他仓库配置

ghcr、Quay、nvcr 等镜像仓库

系统配置

Linux

在 Linux 系统配置镜像服务

Windows/Mac

在 Docker Desktop 配置镜像

MacOS OrbStack

MacOS OrbStack 容器配置

Docker Compose

Docker Compose 项目配置

NAS 设备

群晖

Synology 群晖 NAS 配置

飞牛

飞牛 fnOS 系统配置镜像

绿联

绿联 NAS 系统配置镜像

威联通

QNAP 威联通 NAS 配置

极空间

极空间 NAS 系统配置服务

网络设备

爱快路由

爱快 iKuai 路由系统配置

宝塔面板

在宝塔面板一键配置镜像

需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单

镜像拉取常见问题

使用与功能问题

docker search 报错:专属域名下仅支持 Docker Hub 查询

docker search 报错问题

网页搜不到镜像:Docker Hub 有但轩辕镜像搜索无结果

镜像搜索不到

离线传输镜像:无法直连时用 docker save/load 迁移

离线传输镜像

Docker 插件安装错误:application/vnd.docker.plugin.v1+json

Docker 插件安装错误

WSL 下 Docker 拉取慢:网络与挂载目录影响及优化

WSL 拉取镜像慢

轩辕镜像是否安全?镜像完整性校验(digest)说明

镜像安全性

如何用轩辕镜像拉取镜像?登录方式与专属域名配置

如何拉取镜像

错误码与失败问题

manifest unknown 错误:镜像不存在或标签错误

manifest unknown 错误

TLS/SSL 证书验证失败:Docker pull 时 HTTPS 证书错误

TLS 证书验证失败

DNS 解析超时:无法解析镜像仓库地址或连接超时

DNS 解析超时

410 Gone 错误:Docker 版本过低导致协议不兼容

410 错误:版本过低

402 Payment Required 错误:流量耗尽错误提示

402 错误:流量耗尽

401 UNAUTHORIZED 错误:身份认证失败或登录信息错误

身份认证失败错误

429 Too Many Requests 错误:请求频率超出专业版限制

429 限流错误

Docker login 凭证保存错误:Cannot autolaunch D-Bus(不影响登录)

凭证保存错误

账号 / 计费 / 权限

免费版与专业版区别:功能、限额与使用场景对比

免费版与专业版区别

支持的镜像仓库:Docker Hub、GCR、GHCR、K8s 等列表

轩辕镜像支持的镜像仓库

拉取失败是否扣流量?计费规则说明

拉取失败流量计费

KYSEC 权限不够:麒麟 V10/统信 UOS 下脚本执行被拦截

KYSEC 权限错误

如何申请开具发票?(增值税普票/专票)

开具发票

如何修改网站与仓库登录密码?

修改网站和仓库密码

配置与原理类

registry-mirrors 未生效:仍访问官方仓库或报错的原因

registry-mirrors 未生效

如何去掉镜像名称中的轩辕域名前缀?(docker tag)

去掉域名前缀

如何拉取指定架构镜像?(ARM64/AMD64 等多架构)

拉取指定架构镜像

查看全部问题→

用户好评

来自真实用户的反馈,见证轩辕镜像的优质服务

用户头像

oldzhang

运维工程师

Linux服务器

5

"Docker访问体验非常流畅,大镜像也能快速完成下载。"

轩辕镜像
镜像详情
...
igeshosk/localstack
博客公告Docker 镜像公告与技术博客
热门镜像查看热门 Docker 镜像推荐
一键安装一键安装 Docker 并配置镜像源
镜像拉取问题咨询请 提交工单,官方技术交流群:1072982923。轩辕镜像所有镜像均来源于原始仓库,本站不存储、不修改、不传播任何镜像内容。
镜像拉取问题咨询请提交工单,官方技术交流群:。轩辕镜像所有镜像均来源于原始仓库,本站不存储、不修改、不传播任何镜像内容。
商务合作:点击复制邮箱
©2024-2026 源码跳动
商务合作:点击复制邮箱Copyright © 2024-2026 杭州源码跳动科技有限公司. All rights reserved.