Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
report
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
ISC2
virtu
report
Commits
8861b6f8
Verified
Commit
8861b6f8
authored
11 months ago
by
iliya.saroukha
Browse files
Options
Downloads
Patches
Plain Diff
feat: finished lab8
parent
241f0fcf
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#32473
passed
11 months ago
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
content/08_dockerfiles.md
+48
-0
48 additions, 0 deletions
content/08_dockerfiles.md
with
48 additions
and
0 deletions
content/08_dockerfiles.md
+
48
−
0
View file @
8861b6f8
...
...
@@ -363,3 +363,51 @@ asciicat 1.0 5f22c52d66b2 7 minutes ago 890MB
```
-
Le facteur de taille gagnée est de $
\s
im 69$ (noice) fois.
### Partie 3
### Création d'archives locales pour `ubuntu:22.04` et `alpine:3.20`
En premier lieu, afin de pouvoir s'assurer que nous nous baserons sur des images
"figées" dans le temps, nous devons d'abord exporter le
`rootfs`
locaux en
instanciant des containers à partir des images
`ubuntu:22.04`
et
`alpine:3.20`
.
```
bash
docker run
--rm
-it
ubuntu:22.04 /bin/sh
```
Nous instancions le(s) container(s) en mode intéractif de sorte à pouvoir se
détacher sans qu'il ne se termine immédiatement en exécutant
<Ctrl-p>
et
<Ctrl-q>
.
À présent, nous pouvons créer les archives en exécutant la commande suivante :
```
bash
docker
export
<nom_container>
>
<nom_archive>.tar
```
Le nom du container peut être retrouvé en listant les containers actifs avec la
commande
`docker ps`
.
### Création de l'image `asciicat` à partir des archives locales
À présent, nous pouvons utiliser ces archives pour notre image
`asciicat`
.
```
bash
FROM scratch as BUILDER
ADD ubuntu_22.04.tar /
RUN apt update
-y
&&
apt
install
-y
golang ca-certificates
RUN go
install
github.com/alfg/asciicat@latest
FROM scratch
ADD alpine_3.20.tar /
RUN apk update
COPY
--from
=
builder /root/go/bin/asciicat /usr/bin
COPY
.
.
ENTRYPOINT
[
"usr/bin/asciicat"
]
```
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