Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos #751

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,13 +215,13 @@ to `Dockerfile.reversed`
### New Features

- Container probe feature to use one of the compose services to test/probe the target container (`--container-probe-compose-svc` flag and `container.probe` continue-after mode)
- Ability to override the container image name and/or tag when targetting a compose service (`--target-compose-svc-image` flag)
- Ability to override the container image name and/or tag when targeting a compose service (`--target-compose-svc-image` flag)
- Ability to wait before executing the HTTP probes (`--http-probe-start-wait` flag)
- Ability to wait before starting each compose service (`--compose-svc-start-wait` flag)
- Basic FastCGI protocol support in HTTP probes (docs TBD)
- New `registry` command and a basic `pull` subcommand
- `--include-new` build flag to keep new files created by target during dynamic analysis
- Supprot for stored global param in `slim.config.json`
- Support for stored global param in `slim.config.json`


### Improvements
Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ archlinux latest ... ... 467MB

## Community

Feel free to join any of these channels or just open a new [`Github issue`](https://github.com/slimtoolkit/slim/issues) if you want to chat or if you need help.
Feel free to join any of these channels or just open a new [`GitHub issue`](https://github.com/slimtoolkit/slim/issues) if you want to chat or if you need help.

* [`CNCF Slack channel`](https://cloud-native.slack.com/archives/C059QP1RH1S)
* [`Discord server`](https://discord.gg/9tDyxYS)
Expand Down Expand Up @@ -874,9 +874,9 @@ pipeline {
}
```

### Integrating Slimtoolkit in Github Actions
#### Github Action
Integrating SlimToolkit in Github Actions in your CI/CD workflow involves using the [Docker-Slim Github Action](https://github.com/marketplace/actions/docker-slim-github-action), this Action(snippet below) minifies a target docker image--IMAGE_NAME:latest in your workflow, making it smaller and adjusting the new slimmed image as IMAGE_NAME:slim.
### Integrating Slimtoolkit in GitHub Actions
#### GitHub Action
Integrating SlimToolkit in GitHub Actions in your CI/CD workflow involves using the [Docker-Slim GitHub Action](https://github.com/marketplace/actions/docker-slim-github-action), this Action(snippet below) minifies a target docker image--IMAGE_NAME:latest in your workflow, making it smaller and adjusting the new slimmed image as IMAGE_NAME:slim.
```
# Slim it!
- uses: kitabisa/docker-slim-action@v1
Expand All @@ -886,8 +886,8 @@ Integrating SlimToolkit in Github Actions in your CI/CD workflow involves using
target: IMAGE_NAME:latest
tag: "slim"
```
#### Github Actions Slim Workflow
You can integrate the Docker-Slim Github Action in your workflow by inserting the Action after a [Docker Build/Push Github Action](https://github.com/docker/build-push-action), before [Docker Login Github Action](https://github.com/docker/login-action) and docker tag/push commands, a customized example workflow is highlighted below. Note that the environment variable tag--{{github.run_number}} in the workflow represents a unique incremental number allocated by Github Actions each time your workflow runs.
#### GitHub Actions Slim Workflow
You can integrate the Docker-Slim GitHub Action in your workflow by inserting the Action after a [Docker Build/Push GitHub Action](https://github.com/docker/build-push-action), before [Docker Login GitHub Action](https://github.com/docker/login-action) and docker tag/push commands, a customized example workflow is highlighted below. Note that the environment variable tag--{{github.run_number}} in the workflow represents a unique incremental number allocated by GitHub Actions each time your workflow runs.
```
# Build the Docker image first
- uses: docker/build-push-action@v4
Expand Down Expand Up @@ -915,9 +915,9 @@ You can integrate the Docker-Slim Github Action in your workflow by inserting th
docker push ${{ secrets.DOCKERHUB_USERNAME }}/IMAGE_NAME:slim-{{github.run_number}}
```
The workflow above indicates four steps:
- A [Docker Build/Push Github Action](https://github.com/docker/build-push-action) for building a docker image with the image name/tag--IMAGE_NAME:{{github.run_number}}, you should give replace IMAGE_NAME with your desired image name. Note that this Action must have a false option to push the built image--given that you need the image slimmed/minified before pushing it to a container registry.
- A Docker-Slim Github Action which minifies the target image--IMAGE_NAME:{{github.run_number}}, this Action has the "slim-{{github.run_number}}" tag and adds this tag to the slimmed/minified docker image such that the image name/tag becomes IMAGE_NAME:slim-{{github.run_number}}.
- A Docker Login Github Action which logs into your DockerHub container regristry account, you should store your DockerHub username and personal access token as secrets in the github repository meant for the workflow. Suppose your container registry is not DockerHub, you can check the [Docker Login Github Action documentation](https://github.com/docker/login-action) for the use case of logging into your desired container registry.
- A [Docker Build/Push GitHub Action](https://github.com/docker/build-push-action) for building a docker image with the image name/tag--IMAGE_NAME:{{github.run_number}}, you should give replace IMAGE_NAME with your desired image name. Note that this Action must have a false option to push the built image--given that you need the image slimmed/minified before pushing it to a container registry.
- A Docker-Slim GitHub Action which minifies the target image--IMAGE_NAME:{{github.run_number}}, this Action has the "slim-{{github.run_number}}" tag and adds this tag to the slimmed/minified docker image such that the image name/tag becomes IMAGE_NAME:slim-{{github.run_number}}.
- A Docker Login GitHub Action which logs into your DockerHub container regristry account, you should store your DockerHub username and personal access token as secrets in the github repository meant for the workflow. Suppose your container registry is not DockerHub, you can check the [Docker Login GitHub Action documentation](https://github.com/docker/login-action) for the use case of logging into your desired container registry.
- A docker tag command for naming/tagging the slimmed image with your DockerHub account remote repository name which could be the same name(IMAGE_NAME) as the slimmed image; A docker push command to push the slimmed image to your Dockerhub account remote repository.


Expand Down Expand Up @@ -1011,7 +1011,7 @@ Commands in `probeCmds.json`:
"resource": "/submit"
},
{
"procotol": "http",
"protocol": "http",
"resource": "/api/call?arg=one"
},
{
Expand Down Expand Up @@ -1415,7 +1415,7 @@ DockerSlim was a `Docker Global Hack Day` \#`dockerhackday` project. It barely w

![DHD3](assets/images/dhd/docker_global_hackday3_red.png)

Since then it's been improved and it works pretty well for its core use cases. It can be better though. That's why the project needs your help! You don't need to know much about the container internals, container runtimes and you don't need to know anything about Go. You can contribute in many different ways. For example, use Slim on your images and open Github issues documenting your experience even if it worked just fine :-)
Since then it's been improved and it works pretty well for its core use cases. It can be better though. That's why the project needs your help! You don't need to know much about the container internals, container runtimes and you don't need to know anything about Go. You can contribute in many different ways. For example, use Slim on your images and open GitHub issues documenting your experience even if it worked just fine :-)

## LICENSE

Expand Down
6 changes: 3 additions & 3 deletions ROADMAP.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# High Level Project Roadmap

This is a high level roadmap that identies the current areas of focus. Note that it's not a detailed list of every possible enhancement.
This is a high level roadmap that identities the current areas of focus. Note that it's not a detailed list of every possible enhancement.

* Community
* Collaborate with other CNCF projects to achieve mutually benefitial outcomes
* Collaborate with other CNCF projects to achieve mutually beneficial outcomes
* Talks, outreach, community training
* Engage with the community to increase project contributions

Expand All @@ -23,7 +23,7 @@ This is a high level roadmap that identies the current areas of focus. Note that
* Build/Optimize engine
* Error and logging enhancements to improve debuggability
* Improved build flag documentation with examples
* Improved CI/build tool integration documentation (including Github Actions)
* Improved CI/build tool integration documentation (including GitHub Actions)

* Integrations
* Consign integrations for `xray` (reporting) and `build` (signing)
Expand Down
4 changes: 2 additions & 2 deletions pkg/app/master/command/build/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ const (
FlagCBONetwork = "cbo-network"
FlagCBOCacheFrom = "cbo-cache-from"

//Experimenal flags
//Experimental flags
FlagObfuscateMetadata = "obfuscate-metadata"
)

Expand All @@ -163,7 +163,7 @@ const (

FlagPathPermsUsage = "Set path permissions in optimized image"
FlagPathPermsFileUsage = "File with path permissions to set"
FlagPreservePathUsage = "Keep path from orignal image in its initial state (changes to the selected container image files when it runs will be discarded)"
FlagPreservePathUsage = "Keep path from original image in its initial state (changes to the selected container image files when it runs will be discarded)"
FlagPreservePathFileUsage = "File with paths to keep from original image in their original state (changes to the selected container image files when it runs will be discarded)"
FlagIncludePathUsage = "Keep path from original image"
FlagIncludePathFileUsage = "File with paths to keep from original image"
Expand Down
2 changes: 1 addition & 1 deletion pkg/app/master/command/build/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ func (h *kubeHandler) Handle(
opts.CustomImageTag,
opts.AdditionalTags,
opts.CBOpts,
nil, // TODO: overrrides
nil, // TODO: overrides
nil, // TODO: imageOverrideSelectors,
nil, // TODO: instructions,
opts.DoDeleteFatImage,
Expand Down
2 changes: 1 addition & 1 deletion pkg/app/master/command/run/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func OnCommand(
for {
select {
case evt := <-containerEventCh:
logger.Tracef("Exection Event: name=%s", evt.Event)
logger.Tracef("Execution Event: name=%s", evt.Event)
switch evt.Event {
case container.XEExitedCrash:
xc.Out.Info("target.container.event",
Expand Down
6 changes: 3 additions & 3 deletions pkg/app/master/command/xray/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ func parseDetectUTF8(raw string) (*dockerimage.UTF8Detector, error) {
return nil, fmt.Errorf("malformed find utf8: %s", raw)
}
outTarget = parts[0]
_ = parts[1] // TODO implemement path pattern matcher
_ = parts[1] // TODO implement path pattern matcher
maxSizeBytes := parts[2]
var err error
detector.MaxSizeBytes, err = strconv.Atoi(maxSizeBytes)
Expand All @@ -598,8 +598,8 @@ func parseDetectUTF8(raw string) (*dockerimage.UTF8Detector, error) {
return nil, fmt.Errorf("malformed find utf8: %s", raw)
}
outTarget = parts[0]
_ = parts[1] // TODO implemement path pattern matcher
_ = parts[2] // TODO implemement data regex matcher
_ = parts[1] // TODO implement path pattern matcher
_ = parts[2] // TODO implement data regex matcher
maxSizeBytes := parts[3]
var err error
detector.MaxSizeBytes, err = strconv.Atoi(maxSizeBytes)
Expand Down
2 changes: 1 addition & 1 deletion pkg/app/master/kubernetes/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func (c *Client) Delete(ctx context.Context, info *resource.Info) error {
}

// ResourceBuilderFunc is a helper function to avoid
// passing KuberneteOptions through unrelated code.
// passing KubernetesOptions through unrelated code.
type ResourceBuilderFunc func() *resource.Builder

func NewResourceBuilder(kubeOpts config.KubernetesOptions) *resource.Builder {
Expand Down
2 changes: 1 addition & 1 deletion pkg/app/master/probe/http/custom_probe.go
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ func (p *CustomProbe) Start() {
if port == defaultFastCGIPortStr && cmd.FastCGI == nil {
log.Debugf("HTTP probe - FastCGI default port (%s) used, setting up HTTP probe FastCGI wrapper defaults", port)

// Typicall the entrypoint into a PHP app.
// Typically the entrypoint into a PHP app.
if cmd.Resource == "/" {
cmd.Resource = "/index.php"
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/app/master/probe/http/swagger.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func isOpenAPI(data []byte) bool {
}

func apiSpecPrefix(spec *openapi3.T) (string, error) {
//for now get the api prefix from the first server struc
//for now get the api prefix from the first server struct
//later, support multiple prefixes if there's more than one server struct
var prefix string
for _, sinfo := range spec.Servers {
Expand Down
2 changes: 1 addition & 1 deletion pkg/app/sensor/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func Run() {
log.Info("sensor: Instrumented containers require root and ALL capabilities enabled. Example: `docker run --user root --cap-add ALL app:v1-instrumented`")
}
} else {
log.Info("sensor: run finished succesfully")
log.Info("sensor: run finished successfully")
}

exe.Close()
Expand Down
2 changes: 1 addition & 1 deletion pkg/app/sensor/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ var (
"sensor: ver=",
"sensor: creating monitors...",
"sensor: starting monitors...",
"sensor: run finished succesfully",
"sensor: run finished successfully",
}

sensorLifecycleHookSequence = []string{
Expand Down
12 changes: 6 additions & 6 deletions pkg/app/sensor/artifact/artifact.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ type Processor interface {
ArtifactsDir() string

// Enumerate all files under a given root (used later on to tell the files
// that were created during probing and the existed files appart).
// that were created during probing and the existed files apart).
GetCurrentPaths(root string, excludes []string) (map[string]struct{}, error)

// Create the artifacts folder, preserve some files, etc.
Expand Down Expand Up @@ -1281,7 +1281,7 @@ func (ref *store) saveSSHClient() {
}

for _, bpath := range binArtifacts {
bfpaths, err := resloveLink(bpath)
bfpaths, err := resolveLink(bpath)
if err != nil {
log.Debugf("sensor.store.saveSSHClient: error resolving link - %s (%v)", bpath, err)
// still add the path...
Expand Down Expand Up @@ -1391,7 +1391,7 @@ func (p *store) saveOSLibsNetwork() {
continue
}

fpaths, err := resloveLink(fpath)
fpaths, err := resolveLink(fpath)
if err != nil {
log.Debugf("sensor.store.saveOSLibsNetwork: error resolving link - %s", fpath)
continue
Expand Down Expand Up @@ -1420,7 +1420,7 @@ func (p *store) saveOSLibsNetwork() {
}

for _, bpath := range binArtifacts {
bfpaths, err := resloveLink(bpath)
bfpaths, err := resolveLink(bpath)
if err != nil {
log.Debugf("sensor.store.saveOSLibsNetwork: error resolving link - %s", bpath)
continue
Expand Down Expand Up @@ -1458,7 +1458,7 @@ func (p *store) saveOSLibsNetwork() {
}
}

func resloveLink(fpath string) ([]string, error) {
func resolveLink(fpath string) ([]string, error) {
finfo, err := os.Lstat(fpath)
if err != nil {
return nil, err
Expand Down Expand Up @@ -1564,7 +1564,7 @@ func (p *store) saveCertsData() {
log.Debugf("sensor.store.saveCertsData.copyDirs: fsutil.CopySymlinkFile(%v,%v) error - %v", fname, dstPath, err)
}
} else {
log.Debugf("store.saveCertsData.copyDir: unexpected obect type - %s", fname)
log.Debugf("store.saveCertsData.copyDir: unexpected object type - %s", fname)
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/app/sensor/monitor/fanotify/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ type monitor struct {
artifactsDir string
mountPoint string

// TODO: Move the logic behind these two fields to the artifact processig stage.
// TODO: Move the logic behind these two fields to the artifact processing stage.
includeNew bool
origPaths map[string]struct{}

Expand Down Expand Up @@ -129,7 +129,7 @@ func (m *monitor) Start() error {
}

// Sync part of the start was successful.
// Tracking the completetion of the monitor....
// Tracking the completion of the monitor....

go func() {
logger := m.logger.WithField("op", "collector")
Expand Down
6 changes: 3 additions & 3 deletions pkg/app/sensor/monitor/ptrace/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type monitor struct {

runOpt AppRunOpt

// TODO: Move the logic behind these two fields to the artifact processig stage.
// TODO: Move the logic behind these two fields to the artifact processing stage.
includeNew bool
origPaths map[string]struct{}

Expand Down Expand Up @@ -127,9 +127,9 @@ func (m *monitor) Start() error {

// The sync part of the start was successful.

// Tracking the completetion of the monitor.
// Tracking the completion of the monitor.
go func() {
logger := m.logger.WithField("op", "sensor.pt.monitor.completetion.monitor")
logger := m.logger.WithField("op", "sensor.pt.monitor.completion.monitor")
logger.Info("call")
defer logger.Info("exit")

Expand Down
2 changes: 1 addition & 1 deletion pkg/app/sensor/monitor/ptrace/monitor_arm64.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ type monitor struct {

runOpt AppRunOpt

// TODO: Move the logic behind these two fields to the artifact processig stage.
// TODO: Move the logic behind these two fields to the artifact processing stage.
includeNew bool
origPaths map[string]struct{}

Expand Down
4 changes: 2 additions & 2 deletions pkg/app/sensor/standalone/standalone.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ loop:
break loop

case cmd := <-s.exe.Commands():
log.Infof("sensor: recieved control command => %s", cmd.GetName())
log.Infof("sensor: received control command => %s", cmd.GetName())
if cmd.GetName() == command.StopMonitorName {
s.stopCommandReceived = true
s.signalTargetApp(mon, s.stopSignal)
Expand Down Expand Up @@ -246,7 +246,7 @@ loop:
//
// to avoid competting event loops - this will simplify the code
// and let us avoid subtle race conditions when the stop signal
// arrives while the app is being stoped due to the stop control command.
// arrives while the app is being stopped due to the stop control command.
func (s *Sensor) runSignalForwarder(mon monitor.CompositeMonitor) {
log.Debug("sensor: starting forwarding signals to target app...")

Expand Down
2 changes: 1 addition & 1 deletion pkg/docker/dockerimage/dockerimage.go
Original file line number Diff line number Diff line change
Expand Up @@ -1014,7 +1014,7 @@ func LoadPackage(archivePath string,
archivePath,
configObjectFileName)

//pkg.Config might alread point to a config (v1 or DM)
//pkg.Config might already point to a config (v1 or DM)
//todo: check the difference
pkg.Config = &imageConfig
configObjectFileName = ""
Expand Down
4 changes: 2 additions & 2 deletions pkg/docker/dockerutil/dockerutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ func ListImages(dclient *dockerapi.Client, imageNameFilter string) (map[string]B
// dslimexamples/* <- all image names in the 'dslimexamples' namespace
// dslimexamples/ser* <- all image names starting with 'ser' in the 'dslimexamples' namespace
// dslimexamples/*python* <- all image names with 'python' in them in the 'dslimexamples' namespace
// */*python* <- all image names with 'python' in them in all namesapces (except the default namespace)
// */*alpine <- all image names ending with 'alpine' in all namesapces (except the default namespace)
// */*python* <- all image names with 'python' in them in all namespaces (except the default namespace)
// */*alpine <- all image names ending with 'alpine' in all namespaces (except the default namespace)
// * <- all image names with no/default namespace. note that no images with namespaces will be returned
var err error
if dclient == nil {
Expand Down
4 changes: 2 additions & 2 deletions pkg/docker/instruction/instruction.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ type Format struct {
SupportsNameValues bool
RequiresNameValues bool
SupportsSubInst bool
IsDepricated bool
IsDeprecated bool
}

// Specs is a map of all available instructions and their format info (by name)
Expand Down Expand Up @@ -100,7 +100,7 @@ var Specs = map[string]Format{
},
Maintainer: {
Name: Maintainer,
IsDepricated: true,
IsDeprecated: true,
},
Onbuild: {
Name: Label,
Expand Down
2 changes: 1 addition & 1 deletion pkg/docker/linter/check/id20019.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func init() {
Info: Info{
ID: "ID.20019",
Name: "Unnecessary Layer",
Description: "RUN instruction will result in unnecessary layer (combine command with previous RUN instruciton)",
Description: "RUN instruction will result in unnecessary layer (combine command with previous RUN instruction)",
DetailsURL: "https://lint.dockersl.im/check/ID.20019",
MainMessage: "RUN instruction will result in unnecessary layer",
MatchMessage: "Instruction: start=%d end=%d global_index=%d stage_id=%d stage_index=%d prev_start=%d prev_end=%d prev_global_index=%d prev_stage_index=%d",
Expand Down
2 changes: 1 addition & 1 deletion pkg/lambdaproxy/lambdaproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func DecodeResponse(input []byte, options *DecodeOptions) (HTTPResponse, error)
if response.IsBase64Encoded {
responseBodyBytes, err := base64.StdEncoding.DecodeString(string(response.Body))
if err != nil {
log.Fatalf("Some error occured during base64 decode. Error %s", err.Error())
log.Fatalf("Some error occurred during base64 decode. Error %s", err.Error())
}
response.Body = string(responseBodyBytes)
}
Expand Down
Loading