Skip to content

Commit a3d6744

Browse files
committed
repo reset
1 parent 38b5e20 commit a3d6744

File tree

7 files changed

+137
-56
lines changed

7 files changed

+137
-56
lines changed

.dockerignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.github
2+
README.md
3+
LICENSE.md
4+
Dockerfile
5+
.editorconfig
6+
.gitignore
7+
testing.sh

.editorconfig

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_size = 2
7+
indent_style = space
8+
insert_final_newline = true
9+
max_line_length = 200
10+
tab_width = 2

.github/workflows/container.yml

+111
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: Container Image
2+
on:
3+
push:
4+
branches:
5+
- 'main'
6+
tags:
7+
- '**'
8+
9+
env:
10+
alpine_version: '3.17'
11+
12+
jobs:
13+
build:
14+
name: Build container image and push it to registry
15+
runs-on: ubuntu-latest
16+
permissions:
17+
id-token: write
18+
contents: read
19+
packages: write
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v3
23+
24+
- name: Login to Docker Hub
25+
uses: docker/login-action@v2
26+
with:
27+
username: ${{ secrets.DOCKERHUB_USERNAME }}
28+
password: ${{ secrets.DOCKERHUB_PASSWORD }}
29+
30+
- name: Login to GitHub Container Registry
31+
uses: docker/login-action@v2
32+
with:
33+
registry: ghcr.io
34+
username: ${{ github.actor }}
35+
password: ${{ secrets.GITHUB_TOKEN }}
36+
37+
- name: Configure AWS credentials
38+
uses: aws-actions/configure-aws-credentials@v1
39+
with:
40+
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
41+
aws-region: us-east-1
42+
43+
- name: Login to Amazon ECR Public
44+
id: login-ecr-public
45+
uses: aws-actions/amazon-ecr-login@v1
46+
with:
47+
registry-type: public
48+
49+
- name: Parse version
50+
id: get-version
51+
uses: battila7/get-version-action@v2
52+
53+
- name: Set up QEMU
54+
uses: docker/setup-qemu-action@v2
55+
56+
- name: Set up Docker Buildx
57+
uses: docker/setup-buildx-action@v2
58+
59+
- name: Build and push - testing
60+
uses: docker/build-push-action@v3
61+
if: ${{ !steps.get-version.outputs.is-semver }}
62+
with:
63+
context: .
64+
file: ./Dockerfile
65+
platforms: linux/amd64,linux/arm64
66+
push: true
67+
build-args: |
68+
ALPINE_VERSION=${{ env.alpine_version }}
69+
tags: |
70+
cookielab/alpine:${{ github.ref_name }}
71+
public.ecr.aws/cookielab/alpine:${{ github.ref_name }}
72+
ghcr.io/${{ github.repository }}:${{ github.ref_name }}
73+
74+
- name: Build and push - pre-release
75+
uses: docker/build-push-action@v3
76+
if: ${{ steps.get-version.outputs.is-semver && steps.get-version.outputs.prerelease != '' }}
77+
with:
78+
context: .
79+
file: ./Dockerfile
80+
platforms: linux/amd64,linux/arm64
81+
push: true
82+
build-args: |
83+
ALPINE_VERSION=${{ steps.get-version.outputs.major }}.${{ steps.get-version.outputs.minor }}
84+
tags: |
85+
cookielab/alpine:${{ steps.get-version.outputs.version-without-v }}
86+
public.ecr.aws/cookielab/alpine:${{ steps.get-version.outputs.version-without-v }}
87+
ghcr.io/${{ github.repository }}:${{ steps.get-version.outputs.version-without-v }}
88+
89+
- name: Build and push - stable
90+
uses: docker/build-push-action@v3
91+
if: ${{ steps.get-version.outputs.is-semver && steps.get-version.outputs.prerelease == '' }}
92+
with:
93+
context: .
94+
file: ./Dockerfile
95+
platforms: linux/amd64,linux/arm64
96+
push: true
97+
build-args: |
98+
ALPINE_VERSION=${{ steps.get-version.outputs.major }}.${{ steps.get-version.outputs.minor }}
99+
tags: |
100+
cookielab/alpine:${{ steps.get-version.outputs.version-without-v }}
101+
cookielab/alpine:${{ steps.get-version.outputs.major }}.${{ steps.get-version.outputs.minor }}.${{ steps.get-version.outputs.patch }}
102+
cookielab/alpine:${{ steps.get-version.outputs.major }}.${{ steps.get-version.outputs.minor }}
103+
cookielab/alpine:${{ steps.get-version.outputs.major }}
104+
public.ecr.aws/cookielab/alpine:${{ steps.get-version.outputs.version-without-v }}
105+
public.ecr.aws/cookielab/alpine:${{ steps.get-version.outputs.major }}.${{ steps.get-version.outputs.minor }}.${{ steps.get-version.outputs.patch }}
106+
public.ecr.aws/cookielab/alpine:${{ steps.get-version.outputs.major }}.${{ steps.get-version.outputs.minor }}
107+
public.ecr.aws/cookielab/alpine:${{ steps.get-version.outputs.major }}
108+
ghcr.io/${{ github.repository }}:${{ steps.get-version.outputs.version-without-v }}
109+
ghcr.io/${{ github.repository }}:${{ steps.get-version.outputs.major }}.${{ steps.get-version.outputs.minor }}.${{ steps.get-version.outputs.patch }}
110+
ghcr.io/${{ github.repository }}:${{ steps.get-version.outputs.major }}.${{ steps.get-version.outputs.minor }}
111+
ghcr.io/${{ github.repository }}:${{ steps.get-version.outputs.major }}

.gitlab-ci.yml

-25
This file was deleted.

Dockerfile

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
FROM alpine:3.15
1+
ARG ALPINE_VERSION
2+
FROM alpine:${ALPINE_VERSION}
23

3-
LABEL maintainer "patrik@votocek.cz"
4+
RUN adduser -D -h /container -s /bin/sh -u 1987 container
45

5-
RUN apk --update --no-cache upgrade
6-
RUN apk --update --no-cache add libressl openssl ca-certificates
7-
RUN adduser -D -G nobody -h /container -g container -s /bin/sh -u 1987 container
8-
9-
WORKDIR /container
6+
# container user
107
USER 1987
8+
WORKDIR /container
119

1210
ONBUILD USER root

README.md

+4-19
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,6 @@
1-
# Cookielab - Alpine Linux base image
1+
# cookielab/alpine
22

3-
This image is based on [official Alpine Linux image](https://hub.docker.com/_/alpine?tab=description).
3+
This container image is base image for all alpine variants of cookielab images.
44

5-
We install only SSL/TLS libs and CA certificates. Also creating `container` user (UID 1987) in group `nobody` with homedir set to `/container`.
6-
7-
## Usage
8-
9-
There is no `latest` tag on this image.
10-
11-
```Docker
12-
FROM cookielab/alpine:3.11
13-
14-
# ...
15-
# your commands
16-
# ...
17-
18-
USER 1987
19-
20-
ONBUILD USER root
21-
```
5+
On top of original alpine image it contains user `container` with _uid_ `1987`.
6+
And work dir is set to `/container` with is also home dir of `container` user.

UPDATING.md

-5
This file was deleted.

0 commit comments

Comments
 (0)