mirror of
https://github.com/minoplhy/docker-ripe-atlas.git
synced 2025-05-17 23:40:14 +00:00
first commit
This commit is contained in:
commit
1b79ba01ad
45
Dockerfile
Normal file
45
Dockerfile
Normal file
@ -0,0 +1,45 @@
|
||||
FROM debian:10-slim as builder
|
||||
LABEL image="ripe-atlas-builder"
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
ARG GIT_URL=https://github.com/RIPE-NCC/ripe-atlas-software-probe.git
|
||||
|
||||
RUN apt-get update -y \
|
||||
&& apt-get install -y git tar fakeroot libssl-dev libcap2-bin autoconf automake libtool build-essential python
|
||||
|
||||
WORKDIR /root
|
||||
|
||||
RUN git clone --recursive "$GIT_URL"
|
||||
|
||||
RUN ./ripe-atlas-software-probe/build-config/debian/bin/make-deb
|
||||
|
||||
FROM debian:10-slim
|
||||
LABEL maintainer="dockerhub@public.swineson.me"
|
||||
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
COPY --from=builder /root/atlasswprobe-*.deb /tmp
|
||||
|
||||
RUN ln -s /bin/true /bin/systemctl
|
||||
RUN apt-get update -y \
|
||||
&& apt-get install -y libcap2-bin iproute2 openssh-client procps net-tools gosu \
|
||||
&& dpkg -i /tmp/atlasswprobe-*.deb \
|
||||
&& apt-get install -fy \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& rm- rf /tmp/atlasswprobe-*.deb
|
||||
|
||||
RUN ln -s /usr/local/atlas/bin/ATLAS /usr/local/bin/atlas
|
||||
COPY entrypoint.sh /usr/local/bin
|
||||
|
||||
RUN chmod +x /usr/local/bin/* \
|
||||
&& groupadd -fr atlas \
|
||||
&& usermod -aG atlas atlas \
|
||||
&& chown -R atlas:atlas /var/atlas-probe \
|
||||
&& mkdir -p /var/atlasdata \
|
||||
&& chown -R atlas:atlas /var/atlasdata \
|
||||
&& chmod 777 /var/atlasdata
|
||||
|
||||
WORKDIR /var/atlas-probe
|
||||
VOLUME [ "/var/atlas-probe/etc", "/var/atlas-probe/status" ]
|
||||
|
||||
ENTRYPOINT [ "entrypoint.sh" ]
|
||||
CMD [ "atlas" ]
|
16
README.md
Normal file
16
README.md
Normal file
@ -0,0 +1,16 @@
|
||||
# RIPE Atlas Docker Image
|
||||
|
||||
This is the [RIPE Atlas software probe](https://atlas.ripe.net/docs/software-probe/) packaged as a Docker image.
|
||||
|
||||
## Running
|
||||
|
||||
```shell
|
||||
docker run \
|
||||
--restart=unless-stopped \
|
||||
--memory=256m \
|
||||
--cap-add=SYS_ADMIN --cap-add=CAP_NET_RAW --cap-add=CAP_CHOWN \
|
||||
--mount type=tmpfs,destination=/var/atlasdata \
|
||||
--mount type=bind,src=/var/atlas-probe/etc,dst=/var/atlas-probe/etc \
|
||||
--mount type=bind,src=/var/atlas-probe/status,dst=/var/atlas-probe/status \
|
||||
jamesits/ripe-atlas:latest
|
||||
```
|
79
azure-pipelines.yaml
Normal file
79
azure-pipelines.yaml
Normal file
@ -0,0 +1,79 @@
|
||||
name: $(Date:yyyyMMdd).$(Rev:r)
|
||||
variables:
|
||||
DOCKER_IMAGE_BASENAME: "jamesits/ripe-atlas"
|
||||
|
||||
trigger:
|
||||
batch: true
|
||||
branches:
|
||||
include: [ "master" ]
|
||||
paths:
|
||||
include: [ "*" ]
|
||||
exclude: [ "README.md" ]
|
||||
|
||||
pr:
|
||||
autoCancel: true
|
||||
branches:
|
||||
include:
|
||||
- master
|
||||
paths:
|
||||
exclude:
|
||||
- README.md
|
||||
|
||||
schedules:
|
||||
- cron: "0 3 * * *"
|
||||
displayName: nightly build
|
||||
always: true
|
||||
branches:
|
||||
include:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
- job: docker_nightly
|
||||
displayName: "docker nightly image build"
|
||||
pool:
|
||||
vmImage: "ubuntu-latest"
|
||||
workspace:
|
||||
clean: all
|
||||
timeoutInMinutes: 20
|
||||
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
submodules: true
|
||||
|
||||
- bash: |
|
||||
set -Eeuo pipefail
|
||||
docker build --rm=false -t ripe-atlas .
|
||||
docker images --digests ripe-atlas
|
||||
docker cp $(docker ps -a -f "label=image=ripe-atlas-builder" -f "status=exited" --format "{{.ID}}"):/root ${BUILD_ARTIFACTSTAGINGDIRECTORY}
|
||||
displayName: "Build image"
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
inputs:
|
||||
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
|
||||
artifactName: 'deb'
|
||||
parallel: true
|
||||
parallelCount: 10
|
||||
|
||||
- task: Docker@1
|
||||
displayName: "Docker login"
|
||||
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'), ne(variables['Build.Reason'], 'PullRequest'))
|
||||
inputs:
|
||||
containerregistrytype: 'Container Registry'
|
||||
dockerRegistryEndpoint: "Docker Hub: Jamesits"
|
||||
command: login
|
||||
|
||||
- bash: |
|
||||
set -Eeuo pipefail
|
||||
docker tag dst $(DOCKER_IMAGE_BASENAME):nightly
|
||||
docker push $(DOCKER_IMAGE_BASENAME):nightly
|
||||
displayName: "Push image"
|
||||
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'), ne(variables['Build.Reason'], 'PullRequest'))
|
||||
|
||||
- task: Docker@1
|
||||
displayName: "Docker logout"
|
||||
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'), ne(variables['Build.Reason'], 'PullRequest'))
|
||||
inputs:
|
||||
containerregistrytype: 'Container Registry'
|
||||
dockerRegistryEndpoint: "Docker Hub: Jamesits"
|
||||
command: logout
|
7
entrypoint.sh
Normal file
7
entrypoint.sh
Normal file
@ -0,0 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
set -Eeuo pipefail
|
||||
|
||||
chown -R atlas:atlas /var/atlas-probe/status
|
||||
chown -R atlas:atlas /var/atlas-probe/etc
|
||||
|
||||
exec gosu atlas:atlas "$@"
|
Loading…
x
Reference in New Issue
Block a user