Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
Dockerfiles
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
shore
Dockerfiles
Commits
8a902ac3
Commit
8a902ac3
authored
3 years ago
by
nimrod
Browse files
Options
Downloads
Patches
Plain Diff
Crond image.
parent
36c8bd22
No related branches found
No related tags found
No related merge requests found
Pipeline
#2340
passed
3 years ago
Stage: build
Stage: deploy
Stage: .post
Changes
4
Pipelines
5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitlab-ci.yml
+16
-0
16 additions, 0 deletions
.gitlab-ci.yml
crond/.dockerignore
+1
-0
1 addition, 0 deletions
crond/.dockerignore
crond/Dockerfile
+20
-0
20 additions, 0 deletions
crond/Dockerfile
crond/README.md
+29
-0
29 additions, 0 deletions
crond/README.md
with
66 additions
and
0 deletions
.gitlab-ci.yml
+
16
−
0
View file @
8a902ac3
...
...
@@ -123,3 +123,19 @@ push-sshd:
needs
:
-
job
:
build-sshd
artifacts
:
true
# crond image:
build-crond
:
extends
:
.build
variables
:
CONTEXT
:
crond
push-crond
:
extends
:
.push
variables
:
CONTEXT
:
crond
IMAGE
:
cron
needs
:
-
job
:
build-crond
artifacts
:
true
This diff is collapsed.
Click to expand it.
crond/.dockerignore
0 → 100644
+
1
−
0
View file @
8a902ac3
*
This diff is collapsed.
Click to expand it.
crond/Dockerfile
0 → 100644
+
20
−
0
View file @
8a902ac3
FROM
alpine:3.14
as
downloader
ARG
URL=https://github.com/aptible/supercronic/releases/download/v0.1.12/supercronic-linux-amd64
ARG
SHA1SUM=048b95b48b708983effb2e5c935a1ef8483d9e3e
WORKDIR
/tmp
RUN
wget
-q
$URL
&&
\
echo
"
$SHA1SUM
supercronic-linux-amd64"
>
sha1.sum
&&
\
sha1sum
-c
sha1.sum
&&
\
install
-m
755 supercronic-linux-amd64 /usr/local/bin/supersonic
&&
\
touch
/crontab
FROM
alpine:3.14
COPY
--from=downloader /usr/local/bin/supersonic /usr/local/bin/supersonic
COPY
--from=downloader /crontab /crontab
WORKDIR
/tmp
USER
nobody
CMD
[ "supersonic", "/crontab" ]
HEALTHCHECK
CMD pgrep supersonic
RUN
supersonic
-test
/crontab
ONBUILD
COPY
crontab /crontab
ONBUILD RUN
supersonic
-test
/crontab
This diff is collapsed.
Click to expand it.
crond/README.md
0 → 100644
+
29
−
0
View file @
8a902ac3
# Cron docker
A Docker image for running a Cron daemon, actually running
[
Supersonic
](
https://github.com/aptible/supercronic
)
.
## Usage
There are possible usage patterns for this image. The first is using it in a
multi-stage image build as the source of the
`supersonic`
binary to incorporate
in your own image like so:
```
FROM registry.shore.co.il/cron as supersonic
FROM alpine:latest
COPY --from=supersonic /usr/local/bin/supersonic /usr/local/bin/
```
The other pattern is building on top of this image to run some periodic tasks.
The
`ONBUILD`
commands will copy the crontab file and validate it. Just copy
whatever scripts and install whatever packages you need, like so:
```
FROM registry.shore.co.il/cron
COPY script /usr/local/bin/
USER root
RUN apk add --update --no-cache aws-cli
USER nobody
```
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment