Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
docker-packer-arm
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
Model registry
Operate
Environments
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
Jan Grewe
docker-packer-arm
Commits
75cddbb7
Commit
75cddbb7
authored
5 years ago
by
Jan Grewe
Browse files
Options
Downloads
Patches
Plain Diff
initial commit
parents
Branches
master
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Dockerfile
+24
-0
24 additions, 0 deletions
Dockerfile
README.md
+41
-0
41 additions, 0 deletions
README.md
entrypoint.sh
+3
-0
3 additions, 0 deletions
entrypoint.sh
with
68 additions
and
0 deletions
Dockerfile
0 → 100644
+
24
−
0
View file @
75cddbb7
FROM
golang:buster
AS
builder
RUN
apt-get update
-qq
\
&& apt-get install -qqy git
RUN
git clone
--depth
1 https://github.com/solo-io/packer-builder-arm-image /build
WORKDIR
/build
RUN
go build
FROM
debian:buster
ENV
PACKER_VERSION 1.3.5
COPY
--from=builder /build/packer-builder-arm-image /bin/packer-builder-arm-image
RUN
apt-get update
-qq
\
&& DEBIAN_FRONTEND=noninteractive apt-get install -qqy \
qemu-user-static \
kpartx \
unzip \
sudo \
ansible \
python3-distutils \
&& rm -rf /var/lib/apt/lists/*
ADD
https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip /tmp/packer.zip
RUN
unzip /tmp/packer.zip
-d
/bin
&&
rm
/tmp/packer.zip
WORKDIR
/build
ADD
entrypoint.sh /entrypoint.sh
ENTRYPOINT
["/entrypoint.sh"]
This diff is collapsed.
Click to expand it.
README.md
0 → 100644
+
41
−
0
View file @
75cddbb7
# Packer ARM builder
This Docker image can be used to build ARM images like Raspbian with Packer.
## Usage
```
docker run --rm -v ${PWD}:/build -v ${PWD}/packer_cache:/build/packer_cache -v ${PWD}/output:/build/output -v /dev:/dev --privileged jangrewe/packer-arm:latest build my-image.json
```
-
`my-image.json`
:
```
{
"variables": {
"img_mount_path": "{{ env `PWD` }}/mnt",
},
"builders": [
{
"name": "my-image",
"type": "arm-image",
"iso_url": "https://downloads.raspberrypi.org/raspbian_lite/images/raspbian_lite-2019-09-30/2019-09-26-raspbian-buster-lite.zip",
"iso_checksum_type": "sha256",
"iso_checksum": "a50237c2f718bd8d806b96df5b9d2174ce8b789eda1f03434ed2213bbca6c6ff",
"mount_path": "{{ user `img_mount_path` }}",
"output_directory": "output"
}
],
"provisioners": [
{
"type": "shell-local",
"inline": [
"sudo -E ANSIBLE_FORCE_COLOR=1 PYTHONUNBUFFERED=1 ansible-playbook -i '{{ user `img_mount_path` }}', -c chroot ./my-image.yml"
]
}
]
}
```
-
`my-image.yml`
: a regular Ansible playbook
## Thanks
-
[
packer
](
https://packer.io
)
-
[
packer-builder-arm-image
](
https://github.com/solo-io/packer-builder-arm-image/
)
This diff is collapsed.
Click to expand it.
entrypoint.sh
0 → 100644
+
3
−
0
View file @
75cddbb7
#!/bin/bash
/usr/sbin/update-binfmts
--enable
qemu-arm
>
/dev/null 2>&1
/bin/packer
$@
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