├── .github ├── ISSUE_TEMPLATE.md └── PULL_REQUEST_TEMPLATE.md ├── .travis.yml ├── 3.1 └── Dockerfile ├── 4.0 └── Dockerfile ├── Dockerfile.template ├── LICENSE ├── README.md ├── generate-stackbrew-library.sh └── update.sh /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | This image is officially deprecated in favor of [the standard `python` image](https://hub.docker.com/_/python/), and will receive no further updates after 2017-06-01 (Jun 01, 2017). Please adjust your usage accordingly. 2 | 3 | See the discussion in [docker-library/celery#1](https://github.com/docker-library/celery/issues/1#issuecomment-287655769) and [docker-library/celery#12](https://github.com/docker-library/celery/issues/12) for more details. 4 | 5 | In most cases, using this image required re-installation of application dependencies, so for most applications it ends up being much cleaner to simply install Celery in the application container, and run it via a second command. 6 | 7 | See [the way the `sentry` image handles running a Celery beat and workers](https://github.com/docker-library/docs/blob/d328e02359c6fc9a7f1f3c59efa2893f63e667e4/sentry/README.md#how-to-setup-a-full-sentry-instance) for a concrete example of this pattern being employed (`docker run -d --name sentry-cron ... sentry run cron` and `docker run -d --name sentry-worker-1 ... sentry run worker`). 8 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | This image is officially deprecated in favor of [the standard `python` image](https://hub.docker.com/_/python/), and will receive no further updates after 2017-06-01 (Jun 01, 2017). Please adjust your usage accordingly. 2 | 3 | See the discussion in [docker-library/celery#1](https://github.com/docker-library/celery/issues/1#issuecomment-287655769) and [docker-library/celery#12](https://github.com/docker-library/celery/issues/12) for more details. 4 | 5 | In most cases, using this image required re-installation of application dependencies, so for most applications it ends up being much cleaner to simply install Celery in the application container, and run it via a second command. 6 | 7 | See [the way the `sentry` image handles running a Celery beat and workers](https://github.com/docker-library/docs/blob/d328e02359c6fc9a7f1f3c59efa2893f63e667e4/sentry/README.md#how-to-setup-a-full-sentry-instance) for a concrete example of this pattern being employed (`docker run -d --name sentry-cron ... sentry run cron` and `docker run -d --name sentry-worker-1 ... sentry run worker`). 8 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: bash 2 | services: docker 3 | 4 | env: 5 | - VERSION=4.0 6 | - VERSION=3.1 7 | 8 | install: 9 | - git clone https://github.com/docker-library/official-images.git ~/official-images 10 | 11 | before_script: 12 | - env | sort 13 | - cd "$VERSION" 14 | - image="celery:$VERSION" 15 | 16 | script: 17 | - travis_retry docker build -t "$image" . 18 | - ~/official-images/test/run.sh "$image" 19 | 20 | after_script: 21 | - docker images 22 | 23 | # vim:set et ts=2 sw=2: 24 | -------------------------------------------------------------------------------- /3.1/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.5-slim 2 | 3 | RUN groupadd user && useradd --create-home --home-dir /home/user -g user user 4 | WORKDIR /home/user 5 | 6 | RUN pip install redis 7 | 8 | ENV CELERY_VERSION 3.1.25 9 | 10 | RUN pip install celery=="$CELERY_VERSION" 11 | 12 | RUN { \ 13 | echo 'import os'; \ 14 | echo "BROKER_URL = os.environ.get('CELERY_BROKER_URL', 'amqp://')"; \ 15 | } > celeryconfig.py 16 | 17 | # --link some-rabbit:rabbit "just works" 18 | ENV CELERY_BROKER_URL amqp://guest@rabbit 19 | 20 | USER user 21 | CMD ["celery", "worker"] 22 | -------------------------------------------------------------------------------- /4.0/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.5-slim 2 | 3 | RUN groupadd user && useradd --create-home --home-dir /home/user -g user user 4 | WORKDIR /home/user 5 | 6 | RUN pip install redis 7 | 8 | ENV CELERY_VERSION 4.0.2 9 | 10 | RUN pip install celery=="$CELERY_VERSION" 11 | 12 | RUN { \ 13 | echo 'import os'; \ 14 | echo "BROKER_URL = os.environ.get('CELERY_BROKER_URL', 'amqp://')"; \ 15 | } > celeryconfig.py 16 | 17 | # --link some-rabbit:rabbit "just works" 18 | ENV CELERY_BROKER_URL amqp://guest@rabbit 19 | 20 | USER user 21 | CMD ["celery", "worker"] 22 | -------------------------------------------------------------------------------- /Dockerfile.template: -------------------------------------------------------------------------------- 1 | FROM python:3.5-slim 2 | 3 | RUN groupadd user && useradd --create-home --home-dir /home/user -g user user 4 | WORKDIR /home/user 5 | 6 | RUN pip install redis 7 | 8 | ENV CELERY_VERSION %%VERSION%% 9 | 10 | RUN pip install celery=="$CELERY_VERSION" 11 | 12 | RUN { \ 13 | echo 'import os'; \ 14 | echo "BROKER_URL = os.environ.get('CELERY_BROKER_URL', 'amqp://')"; \ 15 | } > celeryconfig.py 16 | 17 | # --link some-rabbit:rabbit "just works" 18 | ENV CELERY_BROKER_URL amqp://guest@rabbit 19 | 20 | USER user 21 | CMD ["celery", "worker"] 22 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014-2015 Docker, Inc. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included 12 | in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DEPRECATED 2 | 3 | This image is officially deprecated in favor of [the standard `python` image](https://hub.docker.com/_/python/), and will receive no further updates after 2017-06-01 (Jun 01, 2017). Please adjust your usage accordingly. 4 | 5 | See the discussion in [docker-library/celery#1](https://github.com/docker-library/celery/issues/1#issuecomment-287655769) and [docker-library/celery#12](https://github.com/docker-library/celery/issues/12) for more details. 6 | 7 | In most cases, using this image required re-installation of application dependencies, so for most applications it ends up being much cleaner to simply install Celery in the application container, and run it via a second command. 8 | 9 | See [the way the `sentry` image handles running a Celery beat and workers](https://github.com/docker-library/docs/blob/d328e02359c6fc9a7f1f3c59efa2893f63e667e4/sentry/README.md#how-to-setup-a-full-sentry-instance) for a concrete example of this pattern being employed (`docker run -d --name sentry-cron ... sentry run cron` and `docker run -d --name sentry-worker-1 ... sentry run worker`). 10 | 11 | # About this Repo 12 | 13 | This is the Git repo of the Docker [official image](https://docs.docker.com/docker-hub/official_repos/) for [celery](https://registry.hub.docker.com/_/celery/). See [the Docker Hub page](https://registry.hub.docker.com/_/celery/) for the full readme on how to use this Docker image and for information regarding contributing and issues. 14 | 15 | The full readme is generated over in [docker-library/docs](https://github.com/docker-library/docs), specifically in [docker-library/docs/celery](https://github.com/docker-library/docs/tree/master/celery). 16 | 17 | See a change merged here that doesn't show up on the Docker Hub yet? Check [the "library/celery" manifest file in the docker-library/official-images repo](https://github.com/docker-library/official-images/blob/master/library/celery), especially [PRs with the "library/celery" label on that repo](https://github.com/docker-library/official-images/labels/library%2Fcelery). For more information about the official images process, see the [docker-library/official-images readme](https://github.com/docker-library/official-images/blob/master/README.md). 18 | 19 | --- 20 | 21 | - [Travis CI: 22 | ![build status badge](https://img.shields.io/travis/docker-library/celery/master.svg)](https://travis-ci.org/docker-library/celery/branches) 23 | - [Automated `update.sh`: 24 | ![build status badge](https://doi-janky.infosiftr.net/job/update.sh/job/celery/badge/icon)](https://doi-janky.infosiftr.net/job/update.sh/job/celery) 25 | 26 | 27 | -------------------------------------------------------------------------------- /generate-stackbrew-library.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -eu 3 | 4 | declare -A aliases=( 5 | [3.1]='3 latest' 6 | [4.0]='4' 7 | ) 8 | 9 | self="$(basename "$BASH_SOURCE")" 10 | cd "$(dirname "$(readlink -f "$BASH_SOURCE")")" 11 | 12 | versions=( */ ) 13 | versions=( "${versions[@]%/}" ) 14 | 15 | # sort version numbers with highest first 16 | IFS=$'\n'; versions=( $(echo "${versions[*]}" | sort -rV) ); unset IFS 17 | 18 | # get the most recent commit which modified any of "$@" 19 | fileCommit() { 20 | git log -1 --format='format:%H' HEAD -- "$@" 21 | } 22 | 23 | # get the most recent commit which modified "$1/Dockerfile" or any file COPY'd from "$1/Dockerfile" 24 | dirCommit() { 25 | local dir="$1"; shift 26 | ( 27 | cd "$dir" 28 | fileCommit \ 29 | Dockerfile \ 30 | $(git show HEAD:./Dockerfile | awk ' 31 | toupper($1) == "COPY" { 32 | for (i = 2; i < NF; i++) { 33 | print $i 34 | } 35 | } 36 | ') 37 | ) 38 | } 39 | 40 | cat <<-EOH 41 | # this file is generated via https://github.com/docker-library/celery/blob/$(fileCommit "$self")/$self 42 | 43 | Maintainers: Tianon Gravi (@tianon), 44 | Joseph Ferguson (@yosifkit) 45 | GitRepo: https://github.com/docker-library/celery.git 46 | EOH 47 | 48 | # prints "$2$1$3$1...$N" 49 | join() { 50 | local sep="$1"; shift 51 | local out; printf -v out "${sep//%/%%}%s" "$@" 52 | echo "${out#$sep}" 53 | } 54 | 55 | for version in "${versions[@]}"; do 56 | commit="$(dirCommit "$version")" 57 | 58 | fullVersion="$(git show "$commit":"$version/Dockerfile" | awk '$1 == "ENV" && $2 == "CELERY_VERSION" { print $3; exit }')" 59 | 60 | versionAliases=() 61 | while [ "$fullVersion" != "$version" -a "${fullVersion%[.-]*}" != "$fullVersion" ]; do 62 | versionAliases+=( $fullVersion ) 63 | fullVersion="${fullVersion%[.-]*}" 64 | done 65 | versionAliases+=( 66 | $version 67 | ${aliases[$version]:-} 68 | ) 69 | 70 | echo 71 | cat <<-EOE 72 | Tags: $(join ', ' "${versionAliases[@]}") 73 | GitCommit: $commit 74 | Directory: $version 75 | EOE 76 | done 77 | -------------------------------------------------------------------------------- /update.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -eo pipefail 3 | 4 | cd "$(dirname "$(readlink -f "$BASH_SOURCE")")" 5 | 6 | versions=( "$@" ) 7 | if [ ${#versions[@]} -eq 0 ]; then 8 | versions=( */ ) 9 | fi 10 | versions=( "${versions[@]%/}" ) 11 | 12 | remoteVersions="$(wget -qO- https://pypi.python.org/pypi/celery/json | jq -r '.releases | keys | .[]')" 13 | 14 | travisEnv= 15 | for version in "${versions[@]}"; do 16 | current="$(echo "$remoteVersions" | grep -E '^'"$version" | sort -V | tail -1)" 17 | 18 | ( 19 | set -x 20 | sed -r 's/^(ENV CELERY_VERSION) .*/\1 '"$current"'/' Dockerfile.template > "$version/Dockerfile" 21 | ) 22 | 23 | travisEnv='\n - VERSION='"$version$travisEnv" 24 | done 25 | 26 | travis="$(awk -v 'RS=\n\n' '$1 == "env:" { $0 = "env:'"$travisEnv"'" } { printf "%s%s", $0, RS }' .travis.yml)" 27 | echo "$travis" > .travis.yml 28 | --------------------------------------------------------------------------------