Skip to content

Commit

Permalink
Add fpm image
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorific committed Nov 19, 2023
1 parent 4d1d1bc commit ede7513
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 14 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
base: ${{ github.ref }}
filters: |
aws-cli: 'aws-cli/**'
fpm: 'fpm/**'
meshcmd: 'meshcmd/**'
# Job to build and test each of the modified images
Expand Down
1 change: 0 additions & 1 deletion fpm/.gitignore

This file was deleted.

3 changes: 2 additions & 1 deletion fpm/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ RUN <<EOF
EOF

FROM system-ruby
ARG FPM_VERSION=1.15.1

ENV GEM_PATH=/fpm
ENV PATH="/fpm/bin:${PATH}"
RUN <<EOF
useradd --create-home --shell /bin/bash fpm
gem install --no-document --install-dir=/fpm fpm:1.15.1
gem install --no-document --install-dir=/fpm fpm:${FPM_VERSION}
EOF

USER fpm
Expand Down
22 changes: 21 additions & 1 deletion fpm/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
# fpm
# fpm - packaging made simple

fpm is a tool which lets you easily create packages for Debian, Ubuntu, Fedora,
CentOS, RHEL, Arch Linux, FreeBSD, macOS, and more!

fpm isn’t a new packaging system, it’s a tool to help you make packages for
existing systems with less effort. It does this by offering a command-line
interface to allow you to create packages easily. Here are some examples using
fpm:

- `fpm -s npm -t deb express` – Make a Debian package for the nodejs express library
- `fpm -s cpan -t rpm Fennec` – Make an rpm for the perl Fennec module
- `fpm -s dir -t pacman -n fancy ~/.zshrc` – Put your ~/.zshrc into an Arch Linux pacman package named “fancy”
- `fpm -s python -t freebsd Django` – Create a FreeBSD package containing the Python Django library
- `fpm -s rpm -t deb mysql.rpm` – Convert an rpm to deb

This project has a few important principles which guide development:

- Community: If a newbie has a bad time, it’s a bug.
- Engineering: Make it work, make it right, then make it fast.
- Capabilities: If it doesn’t do a thing today, we can make it do it tomorrow.
4 changes: 0 additions & 4 deletions fpm/build.ninja

This file was deleted.

37 changes: 30 additions & 7 deletions fpm/docker-bake.hcl
Original file line number Diff line number Diff line change
@@ -1,19 +1,42 @@
variable "IMAGE_NAME" {
default = "fpm"
}

variable "VERSION" {
default = "1.15.1"
}

variable "CONTAINER_REGISTRY" {
default = "docker.io/boxcutter"
}

variable "LOCAL_PLATFORM" {
default="${BAKE_LOCAL_PLATFORM}" == "darwin/arm64/v8" ? "linux/arm64/v8" : "${BAKE_LOCAL_PLATFORM}"
}

target "local" {
target "_common" {
args = {
FPM_VERSION = "${VERSION}"
}
dockerfile = "Containerfile"
tags= [
"docker.io/boxcutter/fpm:latest"
tags = [
"${CONTAINER_REGISTRY}/${IMAGE_NAME}:${VERSION}",
"${CONTAINER_REGISTRY}/${IMAGE_NAME}:latest"
]
labels = {
"org.opencontainers.image.source" = "https://github.com/polymathrobotics/oci"
"org.opencontainers.image.licenses" = "Apache-2.0"
"org.opencontainers.image.description" = "Packaging made simple."
"org.opencontainers.image.title" = "${IMAGE_NAME}"
}
}

target "local" {
inherits = ["_common"]
platforms = ["${LOCAL_PLATFORM}"]
}

target "default" {
dockerfile = "Containerfile"
tags= [
"docker.io/boxcutter/fpm:latest"
]
inherits = ["_common"]
platforms = ["linux/amd64", "linux/arm64/v8"]
}
8 changes: 8 additions & 0 deletions fpm/test/controls/fpm.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
describe command('fpm') do
it { should exist }
end

describe command('fpm -h') do
its('exit_status') { should eq 0 }
its('stdout') { should match (/This is fpm version/) }
end

0 comments on commit ede7513

Please sign in to comment.